Correcting for two-phase flow in a digital flowmeter

ABSTRACT

A flowmeter is disclosed. The flowmeter includes a vibratable conduit, and a driver connected to the conduit that is operable to impart motion to the conduit. A sensor is connected to the conduit and is operable to sense the motion of the conduit and generate a sensor signal. A controller is connected to receive the sensor signal. The controller is operable to detect a single-phase flow condition and process the sensor signal using a first process during the single-phase flow condition to generate a validated mass-flow measurement. The controller is also operable to detect a two-phase flow condition and process the sensor signal using a second process during the two-phase flow condition to generate the validated mass-flow measurement.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.12/172,757, filed Jul. 14, 2008, titled “CORRECTING FOR TWO-PHASE FLOWIN A DIGITAL FLOWMETER,” which is a continuation of Ser. No. 11/552,133,filed Oct. 23, 2006, titled “CORRECTING FOR TWO-PHASE FLOW IN A DIGITALFLOWMETER,” now U.S. Pat. No. 7,404,336, issued Jul. 29, 2008 which is acontinuation of U.S. application Ser. No. 11/207,876, filed Aug. 22,2005, titled “CORRECTING FOR TWO-PHASE FLOW IN A DIGITAL FLOWMETER,” nowU.S. Pat. No. 7,124,646, issued Oct. 24, 2006 which is a continuation ofU.S. application Ser. No. 10/831,228, filed Apr. 26, 2004, titled“CORRECTING FOR TWO-PHASE FLOW IN A DIGITAL FLOWMETER,” now U.S. Pat.No. 6,981,424, issued Jan. 3, 2006 which is a continuation of U.S.application Ser. No. 10/339,623, filed Jan. 10, 2003, titled “CORRECTINGFOR TWO-PHASE FLOW IN A DIGITAL FLOWMETER,” now U.S. Pat. No. 6,758,102,which is a continuation of U.S. application Ser. No. 09/815,273, filedMar. 23, 2001, titled “CORRECTING FOR TWO-PHASE FLOW IN A DIGITALFLOWMETER,” now U.S. Pat. No. 6,505,519, issued Jan. 14, 2003. U.S.application Ser. No. 09/815,273 claims priority to U.S. ProvisionalApplication No. 60/191,465, filed Mar. 23, 2000, titled “A NEURALNETWORK TO CORRECT MASS FLOW ERRORS CAUSED BY TWO PHASE FLOW IN ADIGITAL CORIOLIS MASS FLOWMETER,” now expired, and is a continuation ofU.S. application Ser. No. 09/716,644, filed Nov. 21, 2000, titled“DIGITAL FLOWMETER,” now abandoned, which claims priority to U.S.Provisional Application 60/166,742, filed Nov. 22, 1999 and titled“DIGITAL FLOWMETER,” now expired. The subject matter from all of theabove applications is incorporated by reference.

TECHNICAL FIELD

The invention relates to flowmeters.

BACKGROUND

Flowmeters provide information about materials being transferred througha conduit. For example, mass flowmeters provide a direct indication ofthe mass of material being transferred through a conduit. Similarly,density flowmeters, or densitometers, provide an indication of thedensity of material flowing through a conduit. Mass flowmeters also mayprovide an indication of the density of the material.

Coriolis-type mass flowmeters are based on the well-known Corioliseffect, in which material flowing through a rotating conduit becomes aradially traveling mass that is affected by a Coriolis force andtherefore experiences an acceleration. Many Coriolis-type massflowmeters induce a Coriolis force by sinusoidally oscillating a conduitabout a pivot axis orthogonal to the length of the conduit. In such massflowmeters, the Coriolis reaction force experienced by the travelingfluid mass is transferred to the conduit itself and is manifested as adeflection or offset of the conduit in the direction of the Coriolisforce vector in the plane of rotation.

Energy is supplied to the conduit by a driving mechanism that applies aperiodic force to oscillate the conduit. One type of driving mechanismis an electromechanical driver that imparts a force proportional to anapplied voltage. In an oscillating flowmeter, the applied voltage isperiodic, and is generally sinusoidal. The period of the input voltageis chosen so that the motion of the conduit matches a resonant mode ofvibration of the conduit. This reduces the energy needed to sustainoscillation. An oscillating flowmeter may use a feedback loop in which asensor signal that carries instantaneous frequency and phase informationrelated to oscillation of the conduit is amplified and fed back to theconduit using the electromechanical driver.

SUMMARY

In one general aspect, the flowmeter includes a vibratable conduit, adriver connected to the conduit and operable to impart motion to theconduit, and a sensor connected to the conduit and operable to sense themotion of the conduit and to generate a sensor signal. A controller isconnected to receive the sensor signal, and is operable to generate araw mass-flow measurement from the sensor signal, detect a single-phaseflow condition and process the raw mass-flow measurement using a firstprocess during the single-phase flow condition to generate a firstmass-flow measurement, and detect a two-phase flow condition and correctthe raw mass-flow measurement using a second process during thetwo-phase flow condition to generate a second mass-flow measurement.

The second process may include a neural network processor to predict amass-flow error and to calculate an error correction factor used togenerate the second mass-flow measurement. The neural network processormay receive at least one input parameter and apply a set ofpredetermined coefficients to the input parameter.

The neural network processor may be a multi-layer perceptron neuralnetwork processor including an input layer for receiving inputparameters, a hidden layer having processing nodes for applying the setof predetermined coefficients to the input parameters, and an outputlayer that generates an output parameter. The input parameters mayinclude a temperature parameter, a damping parameter, a densityparameter, and an apparent flow rate parameter. The flowmeter mayfurther include a training module connected to the neural networkprocessor to calculate an updated set of coefficients when supplied withtraining data. In other implementations of the flowmeter, the neuralnetwork processor may be a radial basis function network.

In other instances, the second process includes a processor to analyze adensity drop parameter, to predict a mass-flow error, and to calculatean error correction factor used to generate the second mass-flowmeasurement. The processor may execute a bubble model routine to analyzethe density drop parameter.

The first mass-flow measurement may be a validated mass-flow measurementcomprising the raw mass-flow measurement and an uncertainty parametercalculated by the controller. The second mass-flow measurement may be avalidated mass-flow measurement comprising a corrected mass-flowmeasurement generated from the raw mass-flow measurement and anuncertainty parameter calculated by the controller. The controller maygenerate a measurement status parameter associated with the firstmass-flow measurement. The controller also may generate a measurementstatus parameter associated with the second mass-flow measurement.

The flowmeter may include a memory for storing sensor signal datagenerated from the sensor signal for use by the controller. Thecontroller associated with the flowmeter also may include a sensorparameter processing module to analyze the sensor signal data andgenerate sensor signal parameters. The flowmeter also may include astate machine that uses the raw mass-flow measurement and the sensorsignal parameters to detect the single-phase flow condition and thetwo-phase flow condition.

The controller may include an output signal generator that is operableto receive the sensor signal parameters from the sensor parameterprocessing module and to generate a drive signal for the driver basedthe sensor signal parameters. The controller may also include circuitryto generate a drive signal based on the sensor signal. The drive signalmay be a digital drive signal for operating the driver. Alternatively,the drive signal may be an analog drive signal for operating the driver.

The flowmeter may include a second sensor connected to the conduit forsensing the motion of the conduit and generating a second sensor signal,with the controller being connected to receive the second sensor signaland generate the drive signal based on the first sensor signal and thesecond sensor signal using digital signal processing. The flowmeter maygenerate a measurement of a property of material flowing through theconduit based on the first and second sensor signals. The flowmeter mayinclude a second driver, and the controller may generate different drivesignals for the two drivers.

The controller may generate the measurement of the property byestimating a frequency of the first sensor signal, calculating a phasedifference using the first sensor signal, and generating the measurementusing the calculated phase difference. The controller may compensate foramplitude differences in the sensor signals by adjusting the amplitudeof one of the sensor signals. The controller may determine a frequency,amplitude and phase offsets for each sensor signal, and scale the phaseoffsets to an average of the frequencies of the sensor signals. Thecontroller may calculate the phase difference using multiple approachesand selects a result of one of the approaches as the calculated baseddifference. The controller may combine the sensor signals to produce acombined signal and to generate the drive signal based on the combinedsignal. The controller may generate the drive signal by applying a gainto the combined signal.

The controller may generate the drive signal by applying a large gain tothe combined signal to initiate motion of the conduit and generate aperiodic signal having a phase and frequency based on a phase andfrequency of a sensor signal as the drive signal after motion has beeninitiated.

The flowmeter may include a second sensor connected to the conduit andoperable sense the motion of the conduit, and the controller includes afirst signal processor to generate the measurement, a first analog todigital converter connected between the first sensor and the firstsignal processor to provide a first digital sensor signal to the firstsignal processor, and a second analog to digital converter connectedbetween the second sensor and the first signal processor to provide asecond digital sensor signal to the controller. The first signalprocessor may combine the digital sensor signals to produce a combinedsignal and generate a gain signal based on the first and second digitalsensor signals. The controller may further include a multiplying digitalto analog converter connected to receive the combined signal and thegain signal from the first signal processor to generate the drive signalas a product of the combined signal and the gain signal.

The flowmeter also may include circuitry for measuring current suppliedto the driver. The controller may determine a frequency of the sensorsignal by detecting zero-crossings of the sensor signal and countingsamples between zero crossings. The flowmeter also may include aconnection to a control system, wherein the controller transmits themeasurement and results of a uncertainty analysis to the control system.

In another aspect, the flowmeter includes a vibratable conduit, a driverconnected to the conduit and operable to impart motion to the conduit,and a sensor connected to the conduit and operable to sense the motionof the conduit and generate a sensor signal. A controller is connectedto receive the sensor signal, and is operable to detect a single-phaseflow condition and process the sensor signal using a first processduring the single-phase flow condition to generate a validated mass-flowmeasurement, and detect a two-phase flow condition and process thesensor signal using a second process during the two-phase flow conditionto generate the validated mass-flow measurement.

In another aspect, the digital flowmeter includes a vibratable conduit,a driver connected to the conduit and operable to impart motion to theconduit, and a sensor connected to the conduit and operable to sense themotion of the conduit and generate a sensor signal. A controller isconnected to receive the sensor signal and detect a single-phase flowcondition and a two-phase flow condition. The controller includes afirst processing module to analyze the sensor signal during thesingle-phase flow condition and to generate a first mass-flowmeasurement, and includes a second processing module to analyze thesensor signal during the two-phase flow condition and to generate asecond mass-flow measurement. The second processing module includes aneural network processor to predict a mass-flow error and to calculatean error correction factor used to generate the second mass-flowmeasurement. The controller also includes output circuitry to generate adrive signal to operate the driver.

The neural network processor receives at least one input parameter andapplies a set of predetermined coefficients to the input parameter. Theinput parameter may include a set of input parameters including atemperature parameter, a damping parameter, a density parameter, and anapparent flow rate parameter.

The controller may further include a memory for storing sensor signaldata generated from the sensor signal, wherein the controller uses thestored sensor signal data. The controller may include a sensor parameterprocessing module to analyze the sensor signal data and generate sensorsignal parameters.

The digital flowmeter may include a state machine that receives thesensor signal parameters and detects the signal-phase flow condition andthe two-phase flow condition. The output circuitry is operable toreceive the sensor signal parameters from the sensor parameterprocessing module and to generate the drive signal based on the sensorsignal parameters.

The controller may include a memory for storing driver signal datagenerated from the driver, wherein the controller uses the driver signaldata. The controller may include a memory for storing sensor signal datagenerated from the sensor signal and driver signal data generated fromthe driver, wherein the controller uses the sensor signal data and thedriver signal data.

The controller may generate an uncertainty parameter associated with oneof the first mass-flow measurement and the second mass-flow measurement.The controller may also generate a measurement status parameterassociated with one of the first mass-flow measurement and the secondmass-flow measurement.

In another aspect, a method of generating a measurement of a property ofmaterial flowing through a conduit is implemented. The method includessensing motion of the conduit, generating a measurement of a property ofmaterial flowing through the conduit based on the sensed motion, anddetecting a flow condition based on the measurement of the property. Ifthe flow condition is a single-phase flow condition, a first analysisprocess is applied to the measurement of the property using digitalsignal processing to generate a first measurement signal. If the flowcondition is a two-phase flow condition, a second analysis process isapplied to the measurement of the property using a neural networkprocessor. The neural network processor operates to predict a mass-flowerror based on the measurement of the property, generates an errorcorrection factor, and applies the error correction factor to themeasurement of the property to generate a second measurement signal. Inaddition, a drive signal is generated and used to impart motion in theconduit based on the measurement of the property.

Generating the measurement of the property may further include storingsensor signal data in a memory. The sensor signal data may be retrievedfrom the memory, and sensor variables, and sensor variable statisticsmay be calculated from the sensor signal data. The sensor variablestatistics may include mean, standard deviation, and slope for each ofthe sensor variables.

The flowmeter may perform an uncertainty analysis on the firstmeasurement signal and generate an uncertainty parameter associated withthe first measurement signal to produce a validated mass-flowmeasurement signal. A measurement status parameter associated with thevalidated measurement signal may also be generated. The flowmeter mayperform an uncertainty analysis on the second measurement signal andgenerate an uncertainty parameter associated with the second measurementsignal to produce a validated mass-flow measurement signal. Ameasurement status parameter associated with the validated measurementsignal may also be generated.

The techniques may be implemented in a digital flowmeter, such as adigital mass flowmeter, that uses a control and measurement system tocontrol oscillation of the conduit and to generate mass flow and densitymeasurements. Sensors connected to the conduit supply signals to thecontrol and measurement system. The control and measurement systemprocesses the signals to produce a measurement of mass flow and usesdigital signal processing to generate a signal for driving the conduit.The drive signal then is converted to a force that induces oscillationof the conduit.

The digital mass flowmeter provides a number of advantages overtraditional, analog approaches. For example, a processor of theflowmeter allows for the detection of a single-phase flow condition anda two-phase flow condition. The mass-flow measurement can be correctedwhen the flowmeter detects two-phase flow. From a control perspective,use of digital processing techniques permits the application of precise,sophisticated control algorithms that, relative to traditional analogapproaches, provide greater responsiveness, accuracy and adaptability.

The digital control system also permits the use of negative gain incontrolling oscillation of the conduit. Thus, drive signals that are180° out of phase with conduit oscillation may be used to reduce theamplitude of oscillation. The practical implications of this areimportant, particularly in high and variable damping situations where asudden drop in damping can cause an undesirable increase in theamplitude of oscillation. One example of a variable damping situation iswhen aeration occurs in the material flowing through the conduit.

The ability to provide negative feedback also is important when theamplitude of oscillation is controlled to a fixed setpoint that can bechanged under user control. With negative feedback, reductions in theoscillation setpoint can be implemented as quickly as increases in thesetpoint. By contrast, an analog meter that relies solely on positivefeedback must set the gain to zero and wait for system damping to reducethe amplitude to the reduced setpoint.

From a measurement perspective, the digital mass flowmeter can providehigh information bandwidth. For example, a digital measurement systemmay use analog-to-digital converters operating at eighteen bits ofprecision and sampling rates of 55 kHz. The digital measurement systemalso may use sophisticated algorithms to filter and process the data,and may do so starting with the raw data from the sensors and continuingto the final measurement data. This permits extremely high precision,such as, for example, phase precision to five nanoseconds per cycle.Digital processing starting with the raw sensor data also allows forextensions to existing measurement techniques to improve performance innon-ideal situations, such as by detecting and compensating fortime-varying amplitude, frequency, and zero offset.

The control and measurement improvements interact to provide furtherimprovements. For example, control of oscillation amplitude is dependentupon the quality of amplitude measurement. Under normal conditions, thedigital mass flowmeter may maintain oscillation to within twenty partsper million of the desired setpoint. Similarly, improved control has apositive benefit on measurement. Increasing the stability of oscillationwill improve measurement quality even for meters that do not require afixed amplitude of oscillation (i.e., a fixed setpoint). For example,with improved stability, assumptions used for the measurementcalculations are likely to be valid over a wider range of conditions.

The digital mass flowmeter also permits the integration of entirely newfunctionality (e.g., diagnostics) with the measurement and controlprocesses. For example, algorithms for detecting the presence of processaeration can be implemented with compensatory action occurring for bothmeasurement and control if aeration is detected.

In another aspect a flowmeter controller includes an input moduleoperable to receive sensor signals from a sensor connected to avibratable flowtube. The sensor signals relate to a mass flow throughthe flowtube, wherein the mass flow includes a first material having afirst phase and a second material having a second phase. A signalprocessing system is operable to receive the sensor signal, determinesensor signal characteristics, and output drive signal characteristicsfor a drive signal applied to the flowtube, wherein the drive signalcharacteristics include a drive gain necessary to maintain oscillationof the flowtube during the mass flow. A measurement system is operableto determine an actual flow condition of the mass flow, based on anapparent flow condition derived from the sensor signal characteristics,and an output module is operable to output the drive signal.

Other advantages of the digital mass flowmeter result from the limitedamount of hardware employed, which makes the meter simple to construct,debug, and repair in production and in the field. Quick repairs in thefield for improved performance and to compensate for wear of themechanical components (e.g., loops, flanges, sensors and drivers) arepossible because the meter uses standardized hardware components thatmay be replaced with little difficulty, and because softwaremodifications may be made with relative ease. In addition, integrationof diagnostics, measurement, and control is simplified by the simplicityof the hardware and the level of functionality implemented in software.New functionality, such as low power components or components withimproved performance, can be integrated without a major redesign of theoverall control system.

Other features and advantages of the invention will be apparent from thefollowing description, including the drawings, and from the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of a digital mass flowmeter.

FIGS. 2A and 2B are perspective and side views of mechanical componentsof a mass flowmeter.

FIGS. 3A-3C are schematic representations of three modes of motion ofthe flowmeter of FIG. 1.

FIG. 4 is a block diagram of an analog control and measurement circuit.

FIG. 5 is a block diagram of a digital mass flowmeter.

FIG. 6 is a flow chart showing operation of the meter of FIG. 5.

FIGS. 7A and 7B are graphs of sensor data.

FIGS. 8A and 8B are graphs of sensor voltage relative to time.

FIG. 9 is a flow chart of a curve fitting procedure.

FIG. 10 is a flow chart of a procedure for generating phase differences.

FIGS. 11A-11D, 12A-12D, and 13A-13D illustrate drive and sensor voltagesat system startup.

FIG. 14 is a flow chart of a procedure for measuring frequency,amplitude, and phase of sensor data using a synchronous modulationtechnique.

FIGS. 15A and 15B are block diagrams of a mass flowmeter.

FIG. 16 is a flow chart of a procedure implemented by the meter of FIGS.15A and 15B.

FIG. 17 illustrates log-amplitude control of a transfer function.

FIG. 18 is a root locus diagram.

FIGS. 19A-19D are graphs of analog-to-digital converter performancerelative to temperature.

FIGS. 20A-20C are graphs of phase measurements.

FIGS. 21A and 21B are graphs of phase measurements.

FIG. 22 is a flow chart of a zero offset compensation procedure.

FIGS. 23A-23C, 24A, and 24B are graphs of phase measurements.

FIG. 25 is a graph of sensor voltage.

FIG. 26 is a flow chart of a procedure for compensating for dynamiceffects.

FIGS. 27A-35E are graphs illustrating application of the procedure ofFIG. 29.

FIGS. 36A-36L are graphs illustrating phase measurement.

FIG. 37A is a graph of sensor voltages.

FIGS. 37B and 37C are graphs of phase and frequency measurementscorresponding to the sensor voltages of FIG. 37A.

FIGS. 37D and 37E are graphs of correction parameters for the phase andfrequency measurements of FIGS. 37B and 37C.

FIGS. 38A-38H are graphs of raw measurements.

FIGS. 39A-39H are graphs of corrected measurements.

FIGS. 40A-40H are graphs illustrating correction for aeration.

FIG. 41 is a block diagram illustrating the effect of aeration in aconduit.

FIG. 42 is a flow chart of a setpoint control procedure.

FIGS. 43A-43C are graphs illustrating application of the procedure ofFIG. 41.

FIG. 44 is a graph comparing the performance of digital and analogflowmeters.

FIG. 45 is a flow chart showing operation of a self-validating meter.

FIG. 46 is a block diagram of a two-wire digital mass flowmeter.

FIGS. 47A-47C are graphs showing response of the digital mass flowmeterunder wet and empty conditions.

FIG. 48A is a chart showing results for batching from empty trials.

FIG. 48B is a diagram showing an experimental flow rig.

FIG. 49 is a graph showing mass-flow errors against drop in apparentdensity.

FIG. 50 is a graph showing residual mass-flow errors after applyingcorrections.

FIG. 51 is a graph showing on-line response of the self-validatingdigital mass flowmeter to the onset of two-phase flow.

FIG. 52 is a block diagram of a digital controller implementing a neuralnetwork processor that may be used with the digital mass flowmeter.

FIG. 53 is a flow diagram showing the technique for implementing theneural network to predict the mass-flow error and generate an errorcorrection factor to correct the mass-flow measurement signal whentwo-phase flow is detected.

FIG. 54 is a 3D graph showing damping changes under two-phase flowconditions.

FIG. 55 is a flow diagram illustrating the experimental flow rig.

FIG. 56 is a 3D graph showing true mass flow error under two-phase flowconditions.

FIG. 57 is a 3D graph showing corrected mass flow error under two-phaseflow conditions.

FIG. 58 is a graph comparing the uncorrected mass flow measurementsignal with the neural network corrected mass flow measurement signal.

DETAILED DESCRIPTION

Techniques are provided for accounting for the effects of two-phaseflow-in, for example, a digital flowmeter. Before the techniques aredescribed starting with reference to FIG. 40, digital flowmeters arediscussed with reference to FIGS. 1-39.

Referring to FIG. 1, a digital mass flowmeter 100 includes a digitalcontroller 105, one or more motion sensors 110, one or more drivers 115,a conduit 120 (also referred to as a flowtube), and a temperature sensor125. The digital controller 105 may be implemented using one or more of,for example, a processor, a field-programmable gate array, an ASIC,other programmable logic or gate arrays, or programmable logic with aprocessor core. The digital controller generates a measurement of massflow through the conduit 120 based at least on signals received from themotion sensors 110. The digital controller also controls the drivers 115to induce motion in the conduit 120. This motion is sensed by the motionsensors 110.

Mass flow through the conduit 120 is related to the motion induced inthe conduit in response to a driving force supplied by the drivers 115.In particular, mass flow is related to the phase and frequency of themotion, as well as to the temperature of the conduit. The digital massflowmeter also may provide a measurement of the density of materialflowing through the conduit. The density is related to the frequency ofthe motion and the temperature of the conduit. Many of the describedtechniques are applicable to a densitometer that provides a measure ofdensity rather than a measure of mass flow.

The temperature in the conduit, which is measured using the temperaturesensor 125, affects certain properties of the conduit, such as itsstiffness and dimensions. The digital controller compensates for thesetemperature effects. The temperature of the digital controller 105affects, for example, the operating frequency of the digital controller.In general, the effects of controller temperature are sufficiently smallto be considered negligible. However, in some instances, the digitalcontroller may measure the controller temperature using a solid statedevice and may compensate for effects of the controller temperature.

A. Mechanical Design

In one implementation, as illustrated in FIGS. 2A and 2B, the conduit120 is designed to be inserted in a pipeline (not shown) having a smallsection removed or reserved to make room for the conduit. The conduit120 includes mounting flanges 12 for connection to the pipeline, and acentral manifold block 16 supporting two parallel planar loops 18 and 20that are oriented perpendicularly to the pipeline. An electromagneticdriver 46 and a sensor 48 are attached between each end of loops 18 and20. Each of the two drivers 46 corresponds to a driver 115 of FIG. 1,while each of the two sensors 48 corresponds to a sensor 110 of FIG. 1.

The drivers 46 on opposite ends of the loops are energized with currentof equal magnitude but opposite sign (i.e., currents that are 180°out-of-phase) to cause straight sections 26 of the loops 18, 20 torotate about their co-planar perpendicular bisector 56, which intersectsthe tube at point P (FIG. 2B). Repeatedly reversing (e.g., controllingsinusoidally) the energizing current supplied to the drivers causes eachstraight section 26 to undergo oscillatory motion that sweeps out a bowtie shape in the horizontal plane about line 56-56, the axis of symmetryof the loop. The entire lateral excursion of the loops at the lowerrounded turns 38 and 40 is small, on the order of 1/16 of an inch for atwo foot long straight section 26 of a pipe having a one inch diameter.The frequency of oscillation is typically about 80 to 90 Hertz.

B. Conduit Motion

The motion of the straight sections of loops 18 and 20 are shown inthree modes in FIGS. 3A, 3B and 3C. In the drive mode shown in FIG. 3B,the loops are driven 180° out-of-phase about their respective points Pso that the two loops rotate synchronously but in the opposite sense.Consequently, respective ends such as A and C periodically come togetherand go apart.

The drive motion shown in FIG. 3B induces the Coriolis mode motion shownin FIG. 3A, which is in opposite directions between the loops and movesthe straight sections 26 slightly toward (or away) from each other. TheCoriolis effect is directly related to mvW, where m is the mass ofmaterial in a cross section of a loop, v is the velocity at which themass is moving (the volumetric flow rate), W is the angular velocity ofthe loop (W=W_(o) sin ωt), and mv is the mass flow rate. The Corioliseffect is greatest when the two straight sections are drivensinusoidally and have a sinusoidally varying angular velocity. Underthese conditions, the Coriolis effect is 90° out-of-phase with the drivesignal.

FIG. 3C shows an undesirable common mode motion that deflects the loopsin the same direction. This type of motion might be produced by an axialvibration in the pipeline in the embodiment of FIGS. 2A and 2B becausethe loops are perpendicular to the pipeline.

The type of oscillation shown in FIG. 3B is called the antisymmetricalmode, and the Coriolis mode of FIG. 3A is called the symmetrical mode.The natural frequency of oscillation in the antisymmetrical mode is afunction of the torsional resilience of the legs. Ordinarily theresonant frequency of the antisymmetrical mode for conduits of the shapeshown in FIGS. 2A and 2B is higher than the resonant frequency of thesymmetrical mode. To reduce the noise sensitivity of the mass flowmeasurement, it is desirable to maximize the Coriolis force for a givenmass flow rate. As noted above, the loops are driven at their resonantfrequency, and the Coriolis force is directly related to the frequencyat which the loops are oscillating (i.e., the angular velocity of theloops). Accordingly, the loops are driven in the antisymmetrical mode,which tends to have the higher resonant frequency.

Other implementations may include different conduit designs. Forexample, a single loop or a straight tube section may be employed as theconduit.

C. Electronic Design

The digital controller 105 determines the mass flow rate by processingsignals produced by the sensors 48 (i.e., the motion sensors 110)located at opposite ends of the loops. The signal produced by eachsensor includes a component corresponding to the relative velocity atwhich the loops are driven by a driver positioned next to the sensor anda component corresponding to the relative velocity of the loops due toCoriolis forces induced in the loops. The loops are driven in theantisymmetrical mode, so that the components of the sensor signalscorresponding to drive velocity are equal in magnitude but opposite insign. The resulting Coriolis force is in the symmetrical mode so thatthe components of the sensor signals corresponding to Coriolis velocityare equal in magnitude and sign. Thus, differencing the signals cancelsout the Coriolis velocity components and results in a difference that isproportional to the drive velocity. Similarly, summing the signalscancels out the drive velocity components and results in a sum that isproportional to the Coriolis velocity, which, in turn, is proportionalto the Coriolis force. This sum then may be used to determine the massflow rate.

1. Analog Control System

The digital mass flowmeter 100 provides considerable advantages overtraditional, analog mass flowmeters. For use in later discussion, FIG. 4illustrates an analog control system 400 of a traditional massflowmeter. The sensors 48 each produce a voltage signal, with signalV_(A0) being produced by sensor 48 a and signal V_(B0) being produced bysensor 48 b. V_(A0) and V_(B0) correspond to the velocity of the loopsrelative to each other at the positions of the sensors. Prior toprocessing, signals V_(A0) and V_(B0) are amplified at respective inputamplifiers 405 and 410 to produce signals V_(A1) and V_(B1). To correctfor imbalances in the amplifiers and the sensors, input amplifier 410has a variable gain that is controlled by a balance signal coming from afeedback loop that contains a synchronous demodulator 415 and anintegrator 420.

At the output of amplifier 405, signal V_(A1) is of the form:V _(A1) =V _(D) sin ωt+V _(C) cos ωt,and, at the output of amplifier 410, signal V_(B1) is of the form:V _(B1) =V _(D) sin ωt+V _(C) cos ωt,where V_(D) and V_(C) are, respectively, the drive voltage and theCoriolis voltage, and ω is the drive mode angular frequency.

Voltages V_(A1) and V_(B1) are differenced by operational amplifier 425to produce:V _(DRV) =V _(A1) −V _(B1)=2V _(D) sin ωt,where V_(DRV) corresponds to the drive motion and is used to power thedrivers. In addition to powering the drivers, V_(DRV) is supplied to apositive going zero crossing detector 430 that produces an output squarewave F_(DRV) having a frequency corresponding to that of V_(DRV)(ω=2πF_(DRV)). F_(DRV) is used as the input to a digital phase lockedloop circuit 435. F_(DRV) also is supplied to a processor 440.

Voltages V_(A1) and V_(B1) are summed by operational amplifier 445 toproduce:V _(COR) =V _(A1) +V _(B1)=2V _(C) cos ωt,where V_(COR) is related to the induced Coriolis motion.

V_(COR) is supplied to a synchronous demodulator 450 that produces anoutput voltage V_(M) that is directly proportional to mass by rejectingthe components of V_(COR) that do not have the same frequency as, andare not in phase with, a gating signal Q. The phase locked loop circuit435 produces Q, which is a quadrature reference signal that has the samefrequency (ω) as V_(DRV) and is 90° out of phase with V_(DRV) (i.e., inphase with V_(COR)). Accordingly, synchronous demodulator 450 rejectsfrequencies other than ω so that V_(M) corresponds to the amplitude ofV_(COR) at ω. This amplitude is directly proportional to the mass in theconduit.

V_(M) is supplied to a voltage-to-frequency converter 455 that producesa square wave signal F_(M) having a frequency that corresponds to theamplitude of V_(M). The processor 440 then divides F_(M) by F_(DRV) toproduce a measurement of the mass flow rate.

Digital phase locked loop circuit 435 also produces a reference signal Ithat is in phase with V_(DRV) and is used to gate the synchronousdemodulator 415 in the feedback loop controlling amplifier 410. When thegains of the input amplifiers 405 and 410 multiplied by the drivecomponents of the corresponding input signals are equal, the summingoperation at operational amplifier 445 produces zero drive component(i.e., no signal in phase with V_(DRV)) in the signal V_(COR). When thegains of the input amplifiers 405 and 410 are not equal, a drivecomponent exists in V_(COR). This drive component is extracted bysynchronous demodulator 415 and integrated by integrator 420 to generatean error voltage that corrects the gain of input amplifier 410. When thegain is too high or too low, the synchronous demodulator 415 produces anoutput voltage that causes the integrator to change the error voltagethat modifies the gain. When the gain reaches the desired value, theoutput of the synchronous modulator goes to zero and the error voltagestops changing to maintain the gain at the desired value.

2. Digital Control System

FIG. 5 provides a block diagram of an implementation 500 of the digitalmass flowmeter 100 that includes the conduit 120, drivers 46, andsensors 48 of FIGS. 2A and 2B, along with a digital controller 505.Analog signals from the sensors 48 are converted to digital signals byanalog-to-digital (“A/D”) converters 510 and supplied to the controller505. The A/D converters may be implemented as separate converters, or asseparate channels of a single converter.

Digital-to-analog (“D/A”) converters 515 convert digital control signalsfrom the controller 505 to analog signals for driving the drivers 46.The use of a separate drive signal for each driver has a number ofadvantages. For example, the system may easily switch betweensymmetrical and antisymmetrical drive modes for diagnostic purposes. Inother implementations, the signals produced by converters 515 may beamplified by amplifiers prior to being supplied to the drivers 46. Instill other implementations, a single D/A converter may be used toproduce a drive signal applied to both drivers, with the drive signalbeing inverted prior to being provided to one of the drivers to drivethe conduit 120 in the antisymmetrical mode.

High precision resistors 520 and amplifiers 525 are used to measure thecurrent supplied to each driver 46. A/D converters 530 convert themeasured current to digital signals and supply the digital signals tocontroller 505. The controller 505 uses the measured currents ingenerating the driving signals.

Temperature sensors 535 and pressure sensors 540 measure, respectively,the temperature and the pressure at the inlet 545 and the outlet 550 ofthe conduit. A/D converters 555 convert the measured values to digitalsignals and supply the digital signals to the controller 505. Thecontroller 505 uses the measured values in a number of ways. Forexample, the difference between the pressure measurements may be used todetermine a back pressure in the conduit. Since the stiffness of theconduit varies with the back pressure, the controller may account forconduit stiffness based on the determined back pressure.

An additional temperature sensor 560 measures the temperature of thecrystal oscillator 565 used by the A/D converters. An A/D converter 570converts this temperature measurement to a digital signal for use by thecontroller 505. The input/output relationship of the A/D convertersvaries with the operating frequency of the converters, and the operatingfrequency varies with the temperature of the crystal oscillator.Accordingly, the controller uses the temperature measurement to adjustthe data provided by the A/D converters, or in system calibration.

In the implementation of FIG. 5, the digital controller 505 processesthe digitized sensor signals produced by the A/D converters 510according to the procedure 600 illustrated in FIG. 6 to generate themass flow measurement and the drive signal supplied to the drivers 46.Initially, the controller collects data from the sensors (step 605).Using this data, the controller determines the frequency of the sensorsignals (step 610), eliminates zero offset from the sensor signals (step615), and determines the amplitude (step 620) and phase (step 625) ofthe sensor signals. The controller uses these calculated values togenerate the drive signal (step 630) and to generate the mass flow andother measurements (step 635). After generating the drive signals andmeasurements, the controller collects a new set of data and repeats theprocedure. The steps of the procedure 600 may be performed serially orin parallel, and may be performed in varying order.

Because of the relationships between frequency, zero offset, amplitude,and phase, an estimate of one may be used in calculating another. Thisleads to repeated calculations to improve accuracy. For example, aninitial frequency determination used in determining the zero offset inthe sensor signals may be revised using offset-eliminated sensorsignals. In addition, where appropriate, values generated for a cyclemay be used as starting estimates for a following cycle.

a. Data Collection

For ease of discussion, the digitized signals from the two sensors willbe referred to as signals SV₁ and SV₂, with signal SV₁ coming fromsensor 48 a and signal SV₂ coming from sensor 48 b. Although new data isgenerated constantly, it is assumed that calculations are based upondata corresponding to one complete cycle of both sensors. Withsufficient data buffering, this condition will be true so long as theaverage time to process data is less than the time taken to collect thedata. Tasks to be carried out for a cycle include deciding that thecycle has been completed, calculating the frequency of the cycle (or thefrequencies of SV₁ and SV₂), calculating the amplitudes of SV₁ and SV₂,and calculating the phase difference between SV₁ and SV₂. In someimplementations, these calculations are repeated for each cycle usingthe end point of the previous cycle as the start for the next. In otherimplementations, the cycles overlap by 180° or other amounts (e.g., 90°)so that a cycle is subsumed within the cycles that precede and followit.

FIGS. 7A and 7B illustrate two vectors of sampled data from signals SV₁and SV₂, which are named, respectively, sv1_in and sv2_in. The firstsampling point of each vector is known, and corresponds to a zerocrossing of the sine wave represented by the vector. For sv1_in, thefirst sampling point is the zero crossing from a negative value to apositive value, while for sv2_in the first sampling point is the zerocrossing from a positive value to a negative value.

An actual starting point for a cycle (i.e., the actual zero crossing)will rarely coincide exactly with a sampling point. For this reason, theinitial sampling points (start_sample_SV1 and start_sample_SV2) are thesampling points occurring just before the start of the cycle. To accountfor the difference between the first sampling point and the actual startof the cycle, the approach also uses the position (start_offset_SV1 orstart_offset_SV2) between the starting sample and the next sample atwhich the cycle actually begins.

Since there is a phase offset between signals SV₁ and SV₂, sv1_in andsv2_in may start at different sampling points. If both the sample rateand the phase difference are high, there may be a difference of severalsamples between the start of sv1_in and the start of sv2_in. Thisdifference provides a crude estimate of the phase offset, and may beused as a check on the calculated phase offset, which is discussedbelow. For example, when sampling at 55 kHz, one sample corresponds toapproximately 0.5 degrees of phase shift, and one cycle corresponds toabout 800 sample points.

When the controller employs functions such as the sum (A+B) anddifference (A−B), with B weighted to have the same amplitude as A,additional variables (e.g., start_sample_sum and start_offset_sum) trackthe start of the period for each function. The sum and differencefunctions have a phase offset halfway between SV₁ and SV₂.

In one implementation, the data structure employed to store the datafrom the sensors is a circular list for each sensor, with a capacity ofat least twice the maximum number of samples in a cycle. With this datastructure, processing may be carried out on data for a current cyclewhile interrupts or other techniques are used to add data for afollowing cycle to the lists.

Processing is performed on data corresponding to a full cycle to avoiderrors when employing approaches based on sine-waves. Accordingly, thefirst task in assembling data for a cycle is to determine where thecycle begins and ends. When nonoverlapping cycles are employed, thebeginning of the cycle may be identified as the end of the previouscycle. When overlapping cycles are employed, and the cycles overlap by180°, the beginning of the cycle may be identified as the midpoint ofthe previous cycle, or as the endpoint of the cycle preceding theprevious cycle.

The end of the cycle may be first estimated based on the parameters ofthe previous cycle and under the assumption that the parameters will notchange by more than a predetermined amount from cycle to cycle. Forexample, five percent may be used as the maximum permitted change fromthe last cycle's value, which is reasonable since, at sampling rates of55 kHz, repeated increases or decreases of five percent in amplitude orfrequency over consecutive cycles would result in changes of close to5,000 percent in one second.

By designating five percent as the maximum permissible increase inamplitude and frequency, and allowing for a maximum phase change of 5°in consecutive cycles, a conservative estimate for the upper limit onthe end of the cycle for signal SV₁ may be determined as:

${{end\_ sample}{\_ SV1}} \leq {{{start\_ sample}{\_ SV1}} + {\frac{365}{360}*\frac{sample\_ rate}{{est\_ freq}*0.95}}}$where start_sample_SV1 is the first sample of sv1_in, sample_rate is thesampling rate, and est_freq is the frequency from the previous cycle.The upper limit on the end of the cycle for signal SV₂ (end_sample_SV2)may be determined similarly.

After the end of a cycle is identified, simple checks may be made as towhether the cycle is worth processing. A cycle may not be worthprocessing when, for example, the conduit has stalled or the sensorwaveforms are severely distorted. Processing only suitable cyclesprovides considerable reductions in computation.

One way to determine cycle suitability is to examine certain points of acycle to confirm expected behavior. As noted above, the amplitudes andfrequency of the last cycle give useful starting estimates of thecorresponding values for the current cycle. Using these values, thepoints corresponding to 30°, 150°, 210° and 330° of the cycle may beexamined. If the amplitude and frequency were to match exactly theamplitude and frequency for the previous cycle, these points should havevalues corresponding to est_amp/2, est_amp/2, −est_amp/2, and−est_amp/2, respectively, where est_amp is the estimated amplitude of asignal (i.e., the amplitude from the previous cycle). Allowing for afive percent change in both amplitude and frequency, inequalities may begenerated for each quarter cycle. For the 30° point, the inequality is

${{sv1\_ in}\left( {{{start\_ sample}{\_ SV1}} + {\frac{30}{360}*\frac{sample\_ rate}{{est\_ freq}*1.05}}} \right)} > {0.475*{est\_ amp}{\_ SV}}$The inequalities for the other points have the same form, with thedegree offset term (x/360) and the sign of the est_amp_SV1 term havingappropriate values. These inequalities can be used to check that theconduit has vibrated in a reasonable manner.

Measurement processing takes place on the vectors sv1_in(start:end) andsv2_in(start:end) where:start=min(start_sample_SV1,start_sample_SV2), andend=max(end_sample_SV1,end_sample_SV2).The difference between the start and end points for a signal isindicative of the frequency of the signal.

b. Frequency Determination

The frequency of a discretely-sampled pure sine wave may be calculatedby detecting the transition between periods (i.e., by detecting positiveor negative zero-crossings) and counting the number of samples in eachperiod. Using this method, sampling, for example, an 82.2 Hz sine waveat 55 kHz will provide an estimate of frequency with a maximum error of0.15 percent. Greater accuracy may be achieved by estimating thefractional part of a sample at which the zero-crossing actually occurredusing, for example, start_offset_SV1 and start_offset_SV2. Random noiseand zero offset may reduce the accuracy of this approach.

As illustrated in FIGS. 8A and 8B, a more refined method of frequencydetermination uses quadratic interpolation of the square of the sinewave. With this method, the square of the sine wave is calculated, aquadratic function is fitted to match the minimum point of the squaredsine wave, and the zeros of the quadratic function are used to determinethe frequency. Ifsv _(t) =A sin x _(t)+δ+σε_(t),where sv_(t) is the sensor voltage at time t, A is the amplitude ofoscillation, x_(t) is the radian angle at time t (i.e., x_(t)=2πft), δis the zero offset, ε_(t) is a random variable with distribution N(0,1),and σ is the variance of the noise, then the squared function is givenby:sv _(t) ² =A ² sin² x _(t)+2A(δ+σε_(t))sin x _(t)+2δσε_(t)+δ²+σ²ε_(t) ².When x_(t) is close to 2π, sin x_(t) and sin²x_(t) can be approximatedas x_(0t)=x_(t)−2π and x_(0t) ², respectively. Accordingly, for valuesof x_(t) close to 2π, a_(t) can be approximated as:

$\begin{matrix}{a_{t}^{2} \approx {{A^{2}x_{0t}^{2}} + {2{A\left( {\delta + {\sigma ɛ}_{t}} \right)}x_{0t}} + {2{\delta\sigma ɛ}_{t}} + \delta^{2} + {\sigma^{2}ɛ_{t}^{2}}}} \\{\approx {\left( {{A^{2}x_{0t}^{2}} + {2A\;\delta\; x_{0t}} + \delta^{2}} \right) + {{{\sigma ɛ}_{t}\left( {{2A\; x_{0t}} + {2\delta} + {\sigma ɛ}_{t}} \right)}.}}}\end{matrix}$This is a pure quadratic (with a non-zero minimum, assuming δ=0) plusnoise, with the amplitude of the noise being dependent upon both σ andδ. Linear interpolation also could be used.

Error sources associated with this curve fitting technique are randomnoise, zero offset, and deviation from a true quadratic. Curve fittingis highly sensitive to the level of random noise. Zero offset in thesensor voltage increases the amplitude of noise in the sine-squaredfunction, and illustrates the importance of zero offset elimination(discussed below). Moving away from the minimum, the square of even apure sine wave is not entirely quadratic. The most significant extraterm is of fourth order. By contrast, the most significant extra termfor linear interpolation is of third order.

Degrees of freedom associated with this curve fitting technique arerelated to how many, and which, data points are used. The minimum isthree, but more may be used (at greater computational expense) by usingleast-squares fitting. Such a fit is less susceptible to random noise.FIG. 8A illustrates that a quadratic approximation is good up to some20° away from the minimum point. Using data points further away from theminimum will reduce the influence of random noise, but will increase theerrors due to the non-quadratic terms (i.e., fourth order and higher) inthe sine-squared function.

FIG. 9 illustrates a procedure 900 for performing the curve fittingtechnique. As a first step, the controller initializes variables (step905). These variables include end_point, the best estimate of the zerocrossing point; ep_int, the integer value nearest to end_point; s[0 . .. i], the set of all sample points; z[k], the square of the sample pointclosest to end_point; z[0 . . . n−1], a set of squared sample pointsused to calculate end_point; n, the number of sample points used tocalculate end_point (n=2k+1); step_length, the number of samples in sbetween consecutive values in z; and iteration_count, a count of theiterations that the controller has performed.

The controller then generates a first estimate of end_point (step 910).The controller generates this estimate by calculating an estimatedzero-crossing point based on the estimated frequency from the previouscycle and searching around the estimated crossing point (forwards andbackwards) to find the nearest true crossing point (i.e., the occurrenceof consecutive samples with different signs). The controller then setsend_point equal to the sample point having the smaller magnitude of thesamples surrounding the true crossing point.

Next, the controller sets n, the number of points for curve fitting(step 915). The controller sets n equal to 5 for a sample rate of 11kHz, and to 21 for a sample rate of 44 kHz. The controller then setsiteration_count to 0 (step 920) and increments iteration_count (step925) to begin the iterative portion of the procedure.

As a first step in the iterative portion of the procedure, thecontroller selects step_length (step 930) based on the value ofiteration_count. The controller sets step_length equal to 6, 3, or 1depending on whether iteration_count equals, respectively, 1, 2 or 3.

Next, the controller determines ep_int as the integer portion of the sumof end_point and 0.5 (step 935) and fills the z array (step 940). Forexample, when n equals 5, z[0]=s[ep_int−2*step_length]²,z[1]=s[ep_int−step_length]², z[2]=s[ep_int]²,z[3]=s[ep_int+step_length]², and z[4]=s[ep_int+2*step_length]².

Next, the controller uses a filter, such as a Savitzky-Golay filter, tocalculate smoothed values of z[k−1], z[k] and z[k+1] (step 945).Savitzky-Golay smoothing filters are discussed by Press et al. inNumerical Recipes in C, pp. 650-655 (2nd ed., Cambridge UniversityPress, 1995), which is incorporated by reference. The controller thenfits a quadratic to z[k−1], z[k] and z[k+1] (step 950), and calculatesthe minimum value of the quadratic (z*) and the corresponding position(x*) (step 955).

If x* is between the points corresponding to k−1 and k+1 (step 960),then the controller sets end_point equal to x* (step 965). Thereafter,if iteration_count is less than 3 (step 970), the controller incrementsiteration_count (step 925) and repeats the iterative portion of theprocedure.

If x* is not between the points corresponding to k−1 and k+1 (step 960),or if iteration_count equals 3 (step 970), the controller exits theiterative portion of the procedure. The controller then calculates thefrequency based on the difference between end_point and the startingpoint for the cycle, which is known (step 975).

In essence, the procedure 900 causes the controller to make threeattempts to home in on end_point, using smaller step_lengths in eachattempt. If the resulting minimum for any attempt falls outside of thepoints used to fit the curve (i.e., there has been extrapolation ratherthan interpolation), this indicates that either the previous or newestimate is poor, and that a reduction in step size is unwarranted.

The procedure 900 may be applied to at least three different sine wavesproduced by the sensors. These include signals SV₁ and SV₂ and theweighted sum of the two. Moreover, assuming that zero offset iseliminated, the frequency estimates produced for these signals areindependent. This is clearly true for signals SV₁ and SV₂, as the errorson each are independent. It is also true, however, for the weighted sum,as long as the mass flow and the corresponding phase difference betweensignals SV₁ and SV₂ are large enough for the calculation of frequency tobe based on different samples in each case. When this is true, therandom errors in the frequency estimates also should be independent.

The three independent estimates of frequency can be combined to providean improved estimate. This combined estimate is simply the mean of thethree frequency estimates.

c. Zero Offset Compensation

An important error source in a Coriolis transmitter is zero offset ineach of the sensor voltages. Zero offset is introduced into a sensorvoltage signal by drift in the pre-amplification circuitry and theanalog-to-digital converter. The zero offset effect may be worsened byslight differences in the pre-amplification gains for positive andnegative voltages due to the use of differential circuitry. Each errorsource varies between transmitters, and will vary with transmittertemperature and more generally over time with component wear.

An example of the zero offset compensation technique employed by thecontroller is discussed in detail below. In general, the controller usesthe frequency estimate and an integration technique to determine thezero offset in each of the sensor signals. The controller theneliminates the zero offset from those signals. After eliminating zerooffset from signals SV₁ and SV₂, the controller may recalculate thefrequency of those signals to provide an improved estimate of thefrequency.

d. Amplitude Determination

The amplitude of oscillation has a variety of potential uses. Theseinclude regulating conduit oscillation via feedback, balancingcontributions of sensor voltages when synthesizing driver waveforms,calculating sums and differences for phase measurement, and calculatingan amplitude rate of change for measurement correction purposes.

In one implementation, the controller uses the estimated amplitudes ofsignals SV₁ and SV₂ to calculate the sum and difference of signals SV₁and SV₂, and the product of the sum and difference. Prior to determiningthe sum and difference, the controller compensates one of the signals toaccount for differences between the gains of the two sensors. Forexample, the controller may compensate the data for signal SV₂ based onthe ratio of the amplitude of signal SV₁ to the amplitude of signal SV₂so that both signals have the same amplitude.

The controller may produce an additional estimate of the frequency basedon the calculated sum. This estimate may be averaged with previousfrequency estimates to produce a refined estimate of the frequency ofthe signals, or may replace the previous estimates.

The controller may calculate the amplitude according to a Fourier-basedtechnique to eliminate the effects of higher harmonics. A sensor voltagex(t) over a period T (as identified using zero crossing techniques) canbe represented by an offset and a series of harmonic terms as:x(t)=a ₀/2+a ₁ cos(ωt)+a ₂ cos(2ωt)+a ₃ cos(3ωt)+ . . . +b ₁ sin(ωt)+b ₂sin(2ωt)+ . . .With this representation, a non-zero offset a₀ will result in non-zerocosine terms a_(n). Though the amplitude of interest is the amplitude ofthe fundamental component (i.e., the amplitude at frequency ω),monitoring the amplitudes of higher harmonic components (i.e., atfrequencies kω, where k is greater than 1) may be of value fordiagnostic purposes. The values of a_(n) and b_(n) may be calculated as:

${a_{n} = {\frac{2}{T}{\int_{0}^{T}{{x(t)}\cos\; n\;\omega{\mathbb{d}t}}}}},{{{and}\mspace{14mu} b_{n}} = {\frac{2}{T}{\int_{0}^{T}{{x(t)}\sin\; n\;\omega{{\mathbb{d}t}.}}}}}$The amplitude, A_(n), of each harmonic is given by:A _(n)=√{square root over (a _(n) ² +b _(n) ²)}.The integrals are calculated using Simpson's method with quadraticcorrection (described below). The chief computational expense of themethod is calculating the pure sine and cosine functions.

e. Phase Determination

The controller may use a number of approaches to calculate the phasedifference between signals SV₁ and SV₂. For example, the controller maydetermine the phase offset of each harmonic, relative to the startingtime at t=0, as:

$\varphi_{n} = {\tan^{- 1}{\frac{a_{n}}{b_{n}}.}}$The phase offset is interpreted in the context of a single waveform asbeing the difference between the start of the cycle (i.e., thezero-crossing point) and the point of zero phase for the component ofSV(t) of frequency ω. Since the phase offset is an average over theentire waveform, it may be used as the phase offset from the midpoint ofthe cycle. Ideally, with no zero offset and constant amplitude ofoscillation, the phase offset should be zero every cycle. The controllermay determine the phase difference by comparing the phase offset of eachsensor voltage over the same time period.

The amplitude and phase may be generated using a Fourier method thateliminates the effects of higher harmonics. This method has theadvantage that it does not assume that both ends of the conduits areoscillating at the same frequency. As a first step in the method, afrequency estimate is produced using the zero crossings to measure thetime between the start and end of the cycle. If linear variation infrequency is assumed, this estimate equals the time-averaged frequencyover the period. Using the estimated, and assumed time-invariant,frequency w of the cycle, the controller calculates:

${I_{1} = {\frac{2\omega}{\pi}{\int_{0}^{\frac{2\pi}{\omega}}{{{SV}(t)}{\sin\left( {\omega\; t} \right)}{\mathbb{d}t}}}}},{{{and}\mspace{14mu} I_{2}} = {\frac{2\omega}{\pi}{\int_{0}^{\frac{2\pi}{\omega}}{{{SV}(t)}{\cos\left( {\omega\; t} \right)}{\mathbb{d}t}}}}},$where SV(t) is the sensor voltage waveform (i.e., SV₁(t) or SV₂(t)). Thecontroller then determines the estimates of the amplitude and phase:

${{Amp} = \sqrt{I_{1}^{2} + I_{2}^{2}}},{{{and}\mspace{14mu}{Phase}} = {\tan^{- 1}{\frac{I_{2}}{I_{1}}.}}}$

The controller then calculates a phase difference, assuming that theaverage phase and frequency of each sensor signal is representative ofthe entire waveform. Since these frequencies are different for SV₁ andSV₂, the corresponding phases are scaled to the average frequency. Inaddition, the phases are shifted to the same starting point (i.e., themidpoint of the cycle on SV₁). After scaling, they are subtracted toprovide the phase difference:

$\mspace{20mu}{{{{scaled\_ phase}{\_ SV}_{1}} = {{phase\_ SV}_{1}\frac{av\_ freq}{{freq\_ SV}_{1}}}},{{{scaled\_ shift}{\_ SV}_{2}} = \frac{\left( {{midpoint\_ SV}_{2} - {midpoint\_ SV}_{1}} \right)h\;{freq\_ SV}_{2}}{360}},{and}}$$\mspace{20mu}{{{{scaled\_ phase}{\_ SV}_{2}} = {\left( {{phase\_ SV}_{2} + {{scale\_ shift}{\_ SV}_{2}}} \right)\frac{av\_ freq}{{freq\_ SV}_{2}}}},}$where h is the sample length and the midpoints are defined in terms ofsamples:

${midpoint\_ SV}_{x} = \frac{\left( {{startpoint\_ SV}_{x} + {endpoint\_ SV}_{x}} \right)}{2}$

In general, phase and amplitude are not calculated over the sametime-frame for the two sensors. When the flow rate is zero, the twocycle mid-points are coincident. However, they diverge at high flowrates so that the calculations are based on sample sets that are notcoincident in time. This leads to increased phase noise in conditions ofchanging mass flow. At full flow rate, a phase shift of 4° (out of 360°)means that only 99% of the samples in the SV₁ and SV₂ data sets arecoincident. Far greater phase shifts may be observed under aeratedconditions, which may lead to even lower rates of overlap.

FIG. 10 illustrates a modified approach 1000 that addresses this issue.First, the controller finds the frequencies (f₁, f₂) and the mid-points(m₁, m₂) of the SV₁ and SV₂ data sets (d₁, d₂) (step 1005). Assuminglinear shift in frequency from the last cycle, the controller calculatesthe frequency of SV₂ at the midpoint of SV₁ (f_(2m1)) and the frequencyof SV₁ at the midpoint of SV₂ (f_(1m2)) (step 1010).

The controller then calculates the starting and ending points of newdata sets (d_(1m2) and d_(2m1)) with mid-points m₂ and m₁ respectively,and assuming frequencies of f_(1m2) and f_(2m1) (step 1015). These endpoints do not necessarily coincide with zero crossing points. However,this is not a requirement for Fourier-based calculations.

The controller then carries out the Fourier calculations of phase andamplitude on the sets d₁ and d_(2m1), and the phase differencecalculations outlined above (step 1020). Since the mid-points of d₁ andd_(2m1) are identical, scale-shift_SV₂ is always zero and can beignored. The controller repeats these calculations for the data sets d₂and d_(1m2) (step 1025). The controller then generates averages of thecalculated amplitude and phase difference for use in measurementgeneration (step 1030). When there is sufficient separation between themid points m₁ and m₂, the controller also may use the two sets ofresults to provide local estimates of the rates of change of phase andamplitude.

The controller also may use a difference-amplitude method that involvescalculating a difference between SV₁ and SV₂, squaring the calculateddifference, and integrating the result. According to another approach,the controller synthesizes a sine wave, multiplies the sine wave by thedifference between signals SV₁ and SV₂, and integrates the result. Thecontroller also may integrate the product of signals SV₁ and SV₂, whichis a sine wave having a frequency 2f (where f is the average frequencyof signals SV₁ and SV₂), or may square the product and integrate theresult. The controller also may synthesize a cosine wave comparable tothe product sine wave and multiply the synthesized cosine wave by theproduct sine wave to produce a sine wave of frequency 4f that thecontroller then integrates. The controller also may use multiple ones ofthese approaches to produce separate phase measurements, and then maycalculate a mean value of the separate measurements as the final phasemeasurement.

The difference-amplitude method starts with:

${{{SV}_{1}(t)} = {{A_{1}{\sin\left( {{2\pi\;{ft}} + \frac{\varphi}{2}} \right)}\mspace{14mu}{and}\mspace{14mu}{{SV}_{2}(t)}} = {A_{2}{\sin\left( {{2\pi\;{ft}} - \frac{\varphi}{2}} \right)}}}},$where φ is the phase difference between the sensors. Basic trigonometricidentities may be used to define the sum (Sum) and difference (Diff)between the signals as:

${{{Sum} \equiv {{{SV}_{1}(t)} + {\frac{A_{1}}{A_{2}}{{SV}_{2}(t)}}}} = {2A_{1}\cos{\frac{\varphi}{2} \cdot \sin}\; 2\pi\;{ft}}},{and}$${{Diff} \equiv {{{SV}_{1}(t)} - {\frac{A_{1}}{A_{2}}{{SV}_{2}(t)}}}} = {2A_{1}\sin{\frac{\varphi}{2} \cdot \cos}\; 2\pi\;{{ft}.}}$These functions have amplitudes of 2A₁ cos(φ2) and 2A₁ sin(φ2),respectively. The controller calculates data sets for Sum and Diff fromthe data for SV₁ and SV₂, and then uses one or more of the methodsdescribed above to calculate the amplitude of the signals represented bythose data sets. The controller then uses the calculated amplitudes tocalculate the phase difference, φ.

As an alternative, the phase difference may be calculated using thefunction Prod, defined as:

$\begin{matrix}{{{Prod} \equiv {{Sum} \times {Diff}}} = {4A_{1}^{2}\cos{\frac{\varphi}{2} \cdot \sin}{\frac{\varphi}{2} \cdot \cos}\; 2\pi\;{{ft} \cdot \sin}\; 2\pi\;{ft}}} \\{{= {A_{1}^{2}\sin\;{\varphi \cdot \sin}\; 4\pi\;{ft}}},}\end{matrix}$which is a function with amplitude A² sin φ and frequency 2f. Prod canbe generated sample by sample, and φ may be calculated from theamplitude of the resulting sine wave.

The calculation of phase is particularly dependent upon the accuracy ofprevious calculations (i.e., the calculation of the frequencies andamplitudes of SV₁ and SV₂). The controller may use multiple methods toprovide separate (if not entirely independent) estimates of the phase,which may be combined to give an improved estimate.

f. Drive Signal Generation

The controller generates the drive signal by applying a gain to thedifference between signals SV₁ and SV₂. The controller may apply eithera positive gain (resulting in positive feedback) or a negative gain(resulting in negative feedback).

In general, the Q of the conduit is high enough that the conduit willresonate only at certain discrete frequencies. For example, the lowestresonant frequency for some conduits is between 65 Hz and 95 Hz,depending on the density of the process fluid, and irrespective of thedrive frequency. As such, it is desirable to drive the conduit at theresonant frequency to minimize cycle-to-cycle energy loss. Feeding backthe sensor voltage to the drivers permits the drive frequency to migrateto the resonant frequency.

As an alternative to using feedback to generate the drive signal, puresine waves having phases and frequencies determined as described abovemay be synthesized and sent to the drivers. This approach offers theadvantage of eliminating undesirable high frequency components, such asharmonics of the resonant frequency. This approach also permitscompensation for time delays introduced by the analog-to-digitalconverters, processing, and digital-to-analog converters to ensure thatthe phase of the drive signal corresponds to the mid-point of the phasesof the sensor signals. This compensation may be provided by determiningthe time delay of the system components and introducing a phase shiftcorresponding to the time delay.

Another approach to driving the conduit is to use square wave pulses.This is another synthesis method, with fixed (positive and negative)direct current sources being switched on and off at timed intervals toprovide the required energy. The switching is synchronized with thesensor voltage phase. Advantageously, this approach does not requiredigital-to-analog converters.

In general, the amplitude of vibration of the conduit should rapidlyachieve a desired value at startup, so as to quickly provide themeasurement function, but should do so without significant overshoot,which may damage the meter. The desired rapid startup may be achieved bysetting a very high gain so that the presence of random noise and thehigh Q of the conduit are sufficient to initiate motion of the conduit.In one implementation, high gain and positive feedback are used toinitiate motion of the conduit. Once stable operation is attained, thesystem switches to a synthesis approach for generating the drivesignals.

Referring to FIGS. 11A-13D, synthesis methods also may be used toinitiate conduit motion when high gain is unable to do so. For example,if the DC voltage offset of the sensor voltages is significantly largerthan random noise, the application of a high gain will not induceoscillatory motion. This condition is shown in FIGS. 11A-11D, in which ahigh gain is applied at approximately 0.3 seconds. As shown in FIGS. 11Aand 11B, application of the high gain causes one of the drive signals toassume a large positive value (FIG. 11A) and the other to assume a largenegative value (FIG. 11B). The magnitudes of the drive signals vary withnoise in the sensor signals (FIGS. 11C and 11D). However, the amplifiednoise is insufficient to vary the sign of the drive signals so as toinduce oscillation.

FIGS. 12A-12D illustrate that imposition of a square wave over severalcycles can reliably cause a rapid startup of oscillation. Oscillation ofa conduit having a two inch diameter may be established in approximatelytwo seconds. The establishment of conduit oscillation is indicated bythe reduction in the amplitude of the drive signals, as shown in FIGS.12A and 12B. FIGS. 13A-13D illustrate that oscillation of a one inchconduit may be established in approximately half a second.

A square wave also may be used during operation to correct conduitoscillation problems. For example, in some circumstances, flow meterconduits have been known to begin oscillating at harmonics of theresonant frequency of the conduit, such as frequencies on the order of1.5 kHz. When such high frequency oscillations are detected, a squarewave having a more desirable frequency may be used to return the conduitoscillation to the resonant frequency.

g. Measurement Generation

The controller digitally generates the mass flow measurement in a mannersimilar to the approach used by the analog controller. The controlleralso may generate other measurements, such as density.

In one implementation, the controller calculates the mass flow based onthe phase difference in degrees between the two sensor signals(phase_diff), the frequency of oscillation of the conduit (freq), andthe process temperature (temp):T _(z)=temp−T _(c),noneu _(—) mf=tan(π*phase_diff/180), andmassflow=16(MF ₁ *T _(z) ² +MF ₂ *T _(z) +MF ₃)*noneu _(—) mf/freq,where T_(C) is a calibration temperature, MF₁-MF₃ are calibrationconstants calculated during a calibration procedure, and noneu_mf is themass flow in non-engineering units.

The controller calculates the density based on the frequency ofoscillation of the conduit and the process temperature:T _(z)=temp−T _(c),c ₂=freq², anddensity=(D ₁ *T _(z) ² +D ₂ *T _(z) +D ₃)/c ₂ +D ₄ *T _(z) ²,where D₁-D₄ are calibration constants generated during a calibrationprocedure.D. Integration Techniques

Many integration techniques are available, with different techniquesrequiring different levels of computational effort and providingdifferent levels of accuracy. In the described implementation, variantsof Simpson's method are used. The basic technique may be expressed as:

${{\int_{t_{n}}^{t_{n + 2}}{y{\mathbb{d}t}}} \approx {\frac{h}{3}\left( {y_{n} + {4y_{n + 1}} + y_{n + 2}} \right)}},$where t_(k) is the time at sample k, y_(k) is the corresponding functionvalue, and h is the step length. This rule can be applied repeatedly toany data vector with an odd number of data points (i.e., three or morepoints), and is equivalent to fitting and integrating a cubic spline tothe data points. If the number of data points happens to be even, thenthe so-called ⅜ rule can be applied at one end of the interval:

${\int_{t_{n}}^{t_{n + 3}}{y{\mathbb{d}t}}} \approx {\frac{3h}{8}{\left( {y_{n} + {3y_{n + 1}} + {3y_{n + 2}} + y_{n + 3}} \right).}}$

As stated earlier, each cycle begins and ends at some offset (e.g.,start_offset_SV1) from a sampling point. The accuracy of the integrationtechniques are improved considerably by taking these offsets intoaccount. For example, in an integration of a half cycle sine wave, theareas corresponding to partial samples must be included in thecalculations to avoid a consistent underestimate in the result.

Two types of function are integrated in the described calculations:either sine or sine-squared functions. Both are easily approximatedclose to zero where the end points occur. At the end points, the sinewave is approximately linear and the sine-squared function isapproximately quadratic.

In view of these two types of functions, three different integrationmethods have been evaluated. These are Simpson's method with no endcorrection, Simpson's method with linear end correction, and Simpson'smethod with quadratic correction.

The integration methods were tested by generating and sampling pure sineand sine-squared functions, without simulating any analog-to-digitaltruncation error. Integrals were calculated and the results werecompared to the true amplitudes of the signals. The only source of errorin these calculations was due to the integration techniques. The resultsobtained are illustrated in tables A and B.

TABLE A Integration of a sine function Av. S.D. Max. % error (based on1000 simulations) Errors (%) Error (%) Error (%) Simpson Only −3.73e−31.33e−3 6.17e−3 Simpson + linear correction 3.16e−8 4.89e−8 1.56e−7Simpson + quadratic correction 2.00e−4 2.19e−2 5.18e−1

TABLE B Integration of a sine-squared function Av. S.D. Max. % error(based on 1000 simulations Errors (%) Error (%) Error (%) Simpson Only−2.21e−6 1.10e−6 4.39e−3 Simpson + linear correction 2.21e−6 6.93e−72.52e−6 Simpson + quadratic correction 2.15e−11 6.83e−11 1.88e−10

For sine functions, Simpson's method with linear correction was unbiasedwith the smallest standard deviation, while Simpson's method withoutcorrection was biased to a negative error and Simpson's method withquadratic correction had a relatively high standard deviation. Forsine-squared functions, the errors were generally reduced, with thequadratic correction providing the best result. Based on theseevaluations, linear correction is used when integrating sine functionsand quadratic correction is used when integrating sine-squaredfunctions.

E. Synchronous Modulation Technique

FIG. 14 illustrates an alternative procedure 1400 for processing thesensor signals. Procedure 1400 is based on synchronous modulation, suchas is described by Denys et al., in “Measurement of Voltage Phase forthe French Future Defence Plan Against Losses of Synchronism”, IEEETransactions on Power Delivery, 7(1), 62-69, 1992 and by Begovic et al.in “Frequency Tracking in Power Networks in the Presence of Harmonics”,IEEE Transactions on Power Delivery, 8(2), 480-486, 1993, both of whichare incorporated by reference.

First, the controller generates an initial estimate of the nominaloperating frequency of the system (step 1405). The controller thenattempts to measure the deviation of the frequency of a signal x[k](e.g., SV₁) from this nominal frequency:x[k]=A sin [(ω₀+Δω)kh+Φ]+ε(k),where A is the amplitude of the sine wave portion of the signal, ω₀ isthe nominal frequency (e.g., 88 Hz), Δω is the deviation from thenominal frequency, h is the sampling interval, Φ is the phase shift, andε(k) corresponds to the added noise and harmonics.

To generate this measurement, the controller synthesizes two signalsthat oscillate at the nominal frequency (step 1410). The signals arephase shifted by 0 and π/2 and have amplitude of unity. The controllermultiplies each of these signals by the original signal to producesignals y₁ and y₂ (step 1415):

${y_{1} = {{{x\lbrack k\rbrack}{\cos\left( {\omega_{0}{kh}} \right)}} = {{\frac{A}{2}{\sin\left\lbrack {{\left( {{2\omega_{0}} + {\Delta\omega}} \right){kh}} + \Phi} \right\rbrack}} + {\frac{A}{2}{\sin\left( {{{\Delta\omega}\;{kh}} + \Phi} \right)}}}}},\mspace{79mu}{and}$${y_{2} = {{{x\lbrack k\rbrack}{\sin\left( {\omega_{0}{kh}} \right)}} = {{\frac{A}{2}{\cos\left\lbrack {{\left( {{2\omega_{0}} + {\Delta\omega}} \right){kh}} + \Phi} \right\rbrack}} + {\frac{A}{2}{\cos\left( {{{\Delta\omega}\;{kh}} + \Phi} \right)}}}}},$where the first terms of y₁ and y₂ are high frequency (e.g., 176 Hz)components and the second terms are low frequency (e.g., 0 Hz)components. The controller then eliminates the high frequency componentsusing a low pass filter (step 1420):

${y_{1}^{\prime} = {{\frac{A}{2}{\sin\left( {{{\Delta\omega}\;{kh}} + \Phi} \right)}} + {ɛ_{1}\lbrack k\rbrack}}},{{{and}\mspace{14mu} y_{1}^{\prime}} = {{\frac{A}{2}{\cos\left( {{{\Delta\omega}\;{kh}} + \Phi} \right)}} + {ɛ_{2}\lbrack k\rbrack}}},$where ε₁[k] and ε₂[k] represent the filtered noise from the originalsignals. The controller combines these signals to produce u[k] (step1425):

${{u\lbrack k\rbrack} = {{\left( {{y_{1}^{\prime}\lbrack k\rbrack} + {j\;{y_{2}^{\prime}\lbrack k\rbrack}}} \right)\left( {{y_{1}^{\prime}\left\lbrack {k - 1} \right\rbrack} + {j\;{y_{2}^{\prime}\left\lbrack {k - 1} \right\rbrack}}} \right)} = {{{u_{1}\lbrack k\rbrack} + {j\;{u_{2}\lbrack k\rbrack}}} = {{\frac{A^{2}}{4}{\cos\left( {{\Delta\omega}\; h} \right)}} + {j\frac{A^{2}}{4}{\sin\left( {{\Delta\omega}\; h} \right)}}}}}},$which carries the essential information about the frequency deviation.As shown, u₁[k] represents the real component of u[k], while u₂[k]represents the imaginary component.

The controller uses the real and imaginary components of u[k] tocalculate the frequency deviation, Δf (step 1430):

${\Delta\; f} = {\frac{1}{h}\arctan{\frac{u_{2}\lbrack k\rbrack}{u_{1}\lbrack k\rbrack}.}}$The controller then adds the frequency deviation to the nominalfrequency (step 1435) to give the actual frequency:f=Δf+f ₀.

The controller also uses the real and imaginary components of u[k] todetermine the amplitude of the original signal. In particular, thecontroller determines the amplitude as (step 1440):A ²=4√{square root over (u ₁ ² [k]+u ₂ ² [k])}.

Next, the controller determines the phase difference between the twosensor signals (step 1445). Assuming that any noise (ε₁[k] and ε₂[k])remaining after application of the low pass filter described below willbe negligible, noise free versions of y₁′[k] and y₂′[k] (y₁*[k] andy₂*[k]) may be expressed as:

${{y_{1}^{*}\lbrack k\rbrack} = {\frac{A}{2}{\sin\left( {{{\Delta\omega}\;{kh}} + \Phi} \right)}}},{{{and}\mspace{14mu}{y_{2}^{*}\lbrack k\rbrack}} = {\frac{A}{2}{{\cos\left( {{{\Delta\omega}\;{kh}} - \Phi} \right)}.}}}$Multiplying these signals together gives:

$v = {{y_{1}^{*}y_{2}^{*}} = {{\frac{A^{2}}{8}\left\lbrack {{\sin\left( {2\Phi} \right)} + {\sin\left( {2{\Delta\omega}\;{kh}} \right)}} \right\rbrack}.}}$Filtering this signal by a low pass filter having a cutoff frequencynear 0 Hz removes the unwanted component and leaves:

${v^{\prime} = {\frac{A^{2}}{8}{\sin\left( {2\Phi} \right)}}},$from which the phase difference can be calculated as:

$\Phi = {\frac{1}{2}\arcsin{\frac{8v^{\prime}}{A^{2}}.}}$

This procedure relies on the accuracy with which the operating frequencyis initially estimated, as the procedure measures only the deviationfrom this frequency. If a good estimate is given, a very narrow filtercan be used, which makes the procedure very accurate. For typicalflowmeters, the operating frequencies are around 95 Hz (empty) and 82 Hz(full). A first approximation of half range (88 Hz) is used, whichallows a low-pass filter cut-off of 13 Hz. Care must be taken inselecting the cut-off frequency as a very small cut-off frequency canattenuate the amplitude of the sine wave.

The accuracy of measurement also depends on the filteringcharacteristics employed. The attenuation of the filter in the dead-banddetermines the amount of harmonics rejection, while a smaller cutofffrequency improves the noise rejection.

F. Meter with PI Control

FIGS. 15A and 15B illustrate a meter 1500 having a controller 1505 thatuses another technique to generate the signals supplied to the drivers.Analog-to-digital converters 1510 digitize signals from the sensors 48and provide the digitized signals to the controller 1505. The controller1505 uses the digitized signals to calculate gains for each driver, withthe gains being suitable for generating desired oscillations in theconduit. The gains may be either positive or negative. The controller1505 then supplies the gains to multiplying digital-to-analog converters1515. In other implementations, two or more multiplyingdigital-to-analog converters arranged in series may be used to implementa single, more sensitive multiplying digital-to-analog converter.

The controller 1505 also generates drive signals using the digitizedsensor signals. The controller 1505 provides these drive signals todigital-to-analog converters 1520 that convert the signals to analogsignals that are supplied to the multiplying digital-to-analogconverters 1515.

The multiplying digital-to-analog converters 1515 multiply the analogsignals by the gains from the controller 1505 to produce signals fordriving the conduit. Amplifiers 1525 then amplify these signals andsupply them to the drivers 46. Similar results could be obtained byhaving the controller 1505 perform the multiplication performed by themultiplying digital-to-analog converter, at which point the multiplyingdigital-to-analog converter could be replaced by a standarddigital-to-analog converter.

FIG. 15B illustrates the control approach in more detail. Within thecontroller 1505, the digitized sensor signals are provided to anamplitude detector 1550, which determines a measure, a(t), of theamplitude of motion of the conduit using, for example, the techniquedescribed above. A summer 1555 then uses the amplitude a(t) and adesired amplitude a₀ to calculate an error e(t) as:e(t)=a ₀ −a(t).The error e(t) is used by a proportional-integral (“PI”) control block1560 to generate a gain K₀(t). This gain is multiplied by the differenceof the sensor signals to generate the drive signal. The PI control blockpermits high speed response to changing conditions. The amplitudedetector 1550, summer 1555, and PI control block 1560 may be implementedas software processed by the controller 1505, or as separate circuitry.

1. Control Procedure

The meter 1500 operates according to the procedure 1600 illustrated inFIG. 16. Initially, the controller receives digitized data from thesensors (step 1605). Thereafter, the procedure 1600 includes threeparallel branches: a measurement branch 1610, a drive signal generationbranch 1615, and a gain generation branch 1620.

In the measurement branch 1610, the digitized sensor data is used togenerate measurements of amplitude, frequency, and phase, as describedabove (step 1625). These measurements then are used to calculate themass flow rate (step 1630) and other process variables. In general, thecontroller 1505 implements the measurement branch 1610.

In the drive signal generation branch 1615, the digitized signals fromthe two sensors are differenced to generate the signal (step 1635) thatis multiplied by the gain to produce the drive signal. As describedabove, this differencing operation is performed by the controller 1505.In general, the differencing operation produces a weighted differencethat accounts for amplitude differences between the sensor signals.

In the gain generation branch 1620, the gain is calculated using theproportional-integral control block. As noted above, the amplitude,a(t), of motion of the conduit is determined (step 1640) and subtractedfrom the desired amplitude a₀ (step 1645) to calculate the error e(t).Though illustrated as a separate step, generation of the amplitude,a(t), may correspond to generation of the amplitude in the measurementgeneration step 1625. Finally, the PI control block uses the error e(t)to calculate the gain (step 1650).

The calculated gain is multiplied by the difference signal to generatethe drive signal supplied to the drivers (step 1655). As describedabove, this multiplication operation is performed by the multiplying D/Aconverter or may be performed by the controller.

2. PI Control Block

The objective of the PI control block is to sustain in the conduit puresinusoidal oscillations having an amplitude a₀. The behavior of theconduit may be modeled as a simple mass-spring system that may beexpressed as:{umlaut over (x)}+2ζω_(n) {dot over (x)}+ω _(n) ² x=0,where x is a function of time and the displacement of the mass fromequilibrium, ω_(n) is the natural frequency, and ζ is a damping factor,which is assumed to be small (e.g., 0.001). The solution to this forceequation as a function of an output y(t) and an input i(t) is analogousto an electrical network in which the transfer function between asupplied current, i(s), and a sensed output voltage, y(s), is:

$\frac{y(s)}{i(s)} = {\frac{ks}{s^{2} + {2{\zeta\omega}_{n}s} + \omega_{n}^{2}}.}$

To achieve the desired oscillation in the conduit, a positive-feedbackloop having the gain K₀(t) is automatically adjusted by a ‘slow’ outerloop to give:{umlaut over (x)}+(2ζω_(n) −kK ₀(t)){dot over (x)}+ω _(n) ² x=0.The system is assumed to have a “two-time-scales” property, which meansthat variations in K₀(t) are slow enough that solutions to the equationfor x provided above can be obtained by assuming constant damping.

A two-term PI control block that gives zero steady-state error may beexpressed as:K ₀(t)=K _(p) e(t)+K _(i)∫₀ ^(t) e(t)dt,where the error, e(t) (i.e., a₀-a(t)), is the input to the PI controlblock, and K_(p) and K_(i) are constants. In one implementation, witha₀=10, controller constants of K_(p)=0.02 and K_(i)=0.0005 provide aresponse in which oscillations build up quickly. However, this PIcontrol block is nonlinear, which may result in design and operationaldifficulties.

A linear model of the behavior of the oscillation amplitude may bederived by assuming that x(t) equals Aε^(j) ^(ω) ^(t), which results in:{dot over (x)}={dot over (A)}e ^(jωt) +jωe ^(jωt), and{umlaut over (x)}=[Ä−ω ² A]e ^(jωt)+2jω{dot over (A)}e ^(jωt).Substituting these expressions into the expression for oscillation ofthe loop, and separating into real and imaginary terms, gives:jω{2{dot over (A)}+(2ζω_(n) −kK ₀)A}=0, andÄ+(2ζω_(n) −kK ₀){dot over (A)}+(ω_(n) ²−ω²)A=0.A(t) also may be expressed as:

$\frac{\overset{.}{A}}{A} = {{- {\zeta\omega}_{n}} + {\frac{{kK}_{0}}{2}{t.}}}$A solution of this equation is:

${\log\;{A(t)}} = {\left( {{- {\zeta\omega}_{n}} + \frac{{kK}_{0}}{2}} \right){t.}}$Transforming variables by defining a(t) as being equal to log A(t), theequation for A(t) can be written as:

${\frac{\mathbb{d}a}{\mathbb{d}t} = {{- {\zeta\omega}_{n}} + \frac{{kK}_{0}(t)}{2}}},$where K_(o) is now explicitly dependent on time. Taking Laplacetransforms results in:

${{a(s)} = \frac{{- {\zeta\omega}_{n}} - {{{kK}_{0}(s)}/2}}{s}},$which can be interpreted in terms of transfer-functions as in FIG. 17.This figure is of particular significance for the design of controllers,as it is linear for all K_(o) and a, with the only assumption being thetwo-time-scales property. The performance of the closed-loop is robustwith respect to this assumption so that fast responses which areattainable in practice can be readily designed.

From FIG. 17, the term ζω_(n), is a “load disturbance” that needs to beeliminated by the controller (i.e., kK_(o)/2 must equal ζω_(n) for a(t)to be constant). For zero steady-state error this implies that theouter-loop controller must have an integrator (or very large gain). Assuch, an appropriate PI controller, C(s), may be assumed to beK_(p)(1+1/sT_(i)), where T_(i) is a constant. The proportional term isrequired for stability. The term ζω_(n), however, does not affectstability or controller design, which is based instead on the open-looptransfer function:

${{C(s)}{G(s)}} = {\frac{a(s)}{e(s)} = {\frac{{kK}_{p}\left( {1 + {sT}_{i}} \right)}{2s^{2}T_{i}} = {\frac{{{kK}_{p}/2}\left( {s + {1/T_{i}}} \right)}{s^{2}}.}}}$

The root locus for varying K_(p) is shown in FIG. 18. For small K_(p),there are slow underdamped roots. As K_(p) increases, the roots becomereal at the point P for which the controller gain is K_(p)=8/(kT_(i)).Note in particular that the theory does not place any restriction uponthe choice of T_(i). Hence, the response can, in principle, be madecritically damped and as fast as desired by appropriate choices of K_(p)and T_(i).

Although the poles are purely real at point P, this does not mean thereis no overshoot in the closed-loop step response. This is most easilyseen by inspecting the transfer function between the desired value, a₀,and the error e:

${\frac{e(s)}{a_{0}(s)} = {\frac{s^{2}}{s^{2} + {0.5{{kK}_{p}\left( {s + {1/T_{i}}} \right)}}} = \frac{s^{2}}{p_{2}(s)}}},$where p₂ is a second-order polynomial. With a step input, a_(o)(s)=α/s,the response can be written as αp′(t), where p(t) is the inversetransform of 1/p₂(s) and equals a_(i)exp(−λ₁t)+a₂exp(−λ₂t). The signalp(t) increases and then decays to zero so that e(t), which isproportional to p′, must change sign, implying overshoot in a(t). Theset-point a_(o) may be prefiltered to give a pseudo set-point a_(o)*:

${{a_{0}^{*}(s)} = {\frac{1}{1 + {sT}_{i}}{a_{0}(s)}}},$where T_(i) is the known controller parameter. With this prefilter, realcontroller poles should provide overshoot-free step responses. Thisfeature is useful as there may be physical constraints on overshoot(e.g., mechanical interference or overstressing of components).

The root locus of FIG. 18 assumes that the only dynamics are from theinner-loop's gain/log-amplitude transfer function (FIG. 16) and theouter-loop's PI controller C(s) (i.e., that the log-amplitude a=log A ismeasured instantaneously). However, A is the amplitude of an oscillationwhich might be growing or decaying and hence cannot in general bemeasured without taking into account the underlying sinusoid. There areseveral possible methods for measuring A, in addition to those discussedabove. Some are more suitable for use in quasi-steady conditions. Forexample, a phase-locked loop in which a sinusoidal signals(t)=sin(ω_(n)t+Φ₀) locks onto the measured waveformy(t)=A(t)sin(ω_(n)t+Φ₁) may be employed. Thus, a measure of theamplitude a=log A is given by dividing these signals (with appropriatesafeguards and filters). This method is perhaps satisfactory near thesteady-state but not for start-up conditions before there is a lock.

Another approach uses a peak-follower that includes a zero-crossingdetector together with a peak-following algorithm implemented in thecontroller. Zero-crossing methods, however, can be susceptible to noise.In addition, results from a peak-follower are available only everyhalf-cycle and thereby dictate the sample interval for controllerupdates.

Finally, an AM detector may be employed. Given a sine wave y(t)=A sinω_(n)t, an estimate of A may be obtained from Â₁0.5πF{abs(y)}, where F{} is a suitable low-pass filter with unity DC gain. The AM detector isthe simplest approach. Moreover, it does not presume that there areoscillations of any particular frequency, and hence is usable duringstartup conditions. It suffers from a disadvantage that there is aleakage of harmonics into the inner loop which will affect the spectrumof the resultant oscillations. In addition, the filter adds extradynamics into the outer loop such that compromises need to be madebetween speed of response and spectral purity. In particular, an effectof the filter is to constrain the choice of the best T_(i).

The Fourier series for abs(y) is known to be:

${A\;{{abs}\left( {\sin\;\omega_{n}t} \right)}} = {{\frac{2A}{\pi}\left\lbrack {1 + {\frac{2}{3}\cos\; 2\omega_{n}t} - {\frac{2}{15}\cos\; 4\omega_{n}t} + {\frac{2}{35}\cos\; 6\omega_{n}t} + \ldots} \right\rbrack}.}$As such, the output has to be scaled by π/2 to give the correct DCoutput A, and the (even) harmonic terms a_(k) cos 2kω_(n)t have to befiltered out. As all the filter needs to do is to pass the DC componentthrough and reduce all other frequencies, a “brick-wall” filter with acut-off below 2ω_(n) is sufficient. However, the dynamics of the filterwill affect the behavior of the closed-loop. A common choice of filteris in the Butterworth form. For example, the third-order low-pass filterwith a design break-point frequency ω_(b) is:

${F(s)} = {\frac{1}{1 + {2{s/\omega_{b}}} + {2{s^{2}/\omega_{b}^{2}}} + {s^{3}/\omega_{b}^{3}}}.}$At the design frequency the response is 3 dB down; at 2ω_(b) it is −18dB (0.12), and at 4ω_(b) it is −36 dB (0.015) down. Higher-orderButterworth filters have a steeper roll-off, but most of their poles arecomplex and may affect negatively the control-loop's root locus.G. Zero Offset Compensation

As noted above, zero offset may be introduced into a sensor voltagesignal by drift in the pre-amplification circuitry and by theanalog-to-digital converter. Slight differences in the pre-amplificationgains for positive and negative voltages due to the use of differentialcircuitry may worsen the zero offset effect. The errors vary betweentransmitters, and with transmitter temperature and component wear.

Audio quality (i.e., relatively low cost) analog-to-digital convertersmay be employed for economic reasons. These devices are not designedwith DC offset and amplitude stability as high priorities. FIGS. 19A-19Dshow how offset and positive and negative gains vary with chip operatingtemperature for one such converter (the AD1879 converter). Therepeatability of the illustrated trends is poor, and even allowing fortemperature compensation based on the trends, residual zero offset andpositive/negative gain mismatch remain.

If phase is calculated using the time difference between zero crossingpoints on the two sensor voltages, DC offset may lead to phase errors.This effect is illustrated by FIGS. 20A-20C. Each graph shows thecalculated phase offset as measured by the digital transmitter when thetrue phase offset is zero (i.e., at zero flow).

FIG. 20A shows phase calculated based on whole cycles starting withpositive zero-crossings. The mean value is 0.00627 degrees.

FIG. 20B shows phase calculated starting with negative zero-crossings.The mean value is 0.0109 degrees.

FIG. 20C shows phase calculated every half-cycle. FIG. 20C interleavesthe data from FIGS. 20A and 20B. The average phase (−0.00234) is closerto zero than in FIGS. 20A and 20B, but the standard deviation of thesignal is about six times higher.

More sophisticated phase measurement techniques, such as those based onFourier methods, are immune to DC offset. However, it is desirable toeliminate zero offset even when those techniques are used, since data isprocessed in whole-cycle packets delineated by zero crossing points.This allows simpler analysis of the effects of, for example, amplitudemodulation on apparent phase and frequency. In addition, gain mismatchbetween positive and negative voltages will introduce errors into anymeasurement technique.

The zero-crossing technique of phase detection may be used todemonstrate the impact of zero offset and gain mismatch error, and theirconsequent removal. FIGS. 21A and 21B illustrate the long term drift inphase with zero flow. Each point represents an average over one minuteof live data. FIG. 21A shows the average phase, and FIG. 21B shows thestandard deviation in phase. Over several hours, the drift issignificant. Thus, even if the meter were zeroed every day, which inmany applications would be considered an excessive maintenancerequirement, there would still be considerable phase drift.

1. Compensation Technique

A technique for dealing with voltage offset and gain mismatch uses thecomputational capabilities of the digital transmitter and does notrequire a zero flow condition. The technique uses a set of calculationseach cycle which, when averaged over a reasonable period (e.g., 10,000cycles), and excluding regions of major change (e.g., set point change,onset of aeration), converge on the desired zero offset and gainmismatch compensations.

Assuming the presence of up to three higher harmonics, the desiredwaveform for a sensor voltage SV(t) is of the form:SV(t)=A ₁ sin(ωt)+A ₂ sin(2ωt)+A ₃ sin(3ωt)+A ₄ sin(4ωt)where A₁ designates the amplitude of the fundamental frequency componentand A₂-A₄ designate the amplitudes of the three harmonic components.However, in practice, the actual waveform is adulterated with zerooffset Z_(o) (which has a value close to zero) and mismatch between thenegative and positive gains G_(n) and G_(p). Without any loss ofgenerality, it can be assumed that G_(p) equals one and that G_(n) isgiven by:G _(n)=1+ε_(G),where ε_(G) represents the gain mismatch.

The technique assumes that the amplitudes A_(i) and the frequency ω areconstant. This is justified because estimates of Z_(o) and ε_(G) arebased on averages taken over many cycles (e.g., 10,000 interleavedcycles occurring in about 1 minute of operation). When implementing thetechnique, the controller tests for the presence of significant changesin frequency and amplitude to ensure the validity of the analysis. Thepresence of the higher harmonics leads to the use of Fourier techniquesfor extracting phase and amplitude information for specific harmonics.This entails integrating SV(t) and multiplying by a modulating sine orcosine function.

The zero offset impacts the integral limits, as well as the functionalform. Because there is a zero offset, the starting point for calculationof amplitude and phase will not be at the zero phase point of theperiodic waveform SV(t). For zero offset Z_(o), the corresponding phaseoffset is, approximately,

$\varphi_{Z_{0}} = {- {\sin\left( \frac{Z_{0}}{A_{1}} \right)}}$For small phase,

${\varphi_{Z_{o}} = {- \frac{Z_{o}}{A_{1}}}},$with corresponding time delay

$t_{Z_{o}} = {\frac{\varphi_{Z_{o}}}{\omega}.}$

The integrals are scaled so that the limiting value (i.e., as Z_(o) andω_(G) approach zero) equals the amplitude of the relevant harmonic. Thefirst two integrals of interest are:

${I_{1{Ps}} = {\frac{2\omega}{\pi}{\int_{t_{z_{0}}}^{\frac{\pi}{\omega} + t_{z_{0}}}{{\left( {{{SV}(t)} + Z_{0}} \right) \cdot {\sin\left\lbrack {\omega\left( {t - t_{Z_{0}}} \right)} \right\rbrack}}\ {\mathbb{d}t}}}}},{and}$$I_{1{Ns}} = {\frac{2\omega}{\pi}\left( {1 + ɛ_{G}} \right){\int_{\frac{\pi}{\omega}t_{z_{0}}}^{{2\frac{\pi}{\omega}} + t_{z_{0}}}{{\left( {{{SV}(t)} + Z_{0}} \right) \cdot {\sin\left\lbrack {\omega\left( {t - t_{Z_{0}}} \right)} \right\rbrack}}\ {{\mathbb{d}t}.}}}}$These integrals represent what in practice is calculated during a normalFourier analysis of the sensor voltage data. The subscript 1 indicatesthe first harmonic, N and P indicate, respectively, the negative orpositive half cycle, and s and c indicate, respectively, whether a sineor a cosine modulating function has been used.

Strictly speaking, the mid-zero crossing point, and hence thecorresponding integral limits, should be given by π/ω−t_(Zo), ratherthan π/ω+t_(Zo). However, the use of the exact mid-point rather than theexact zero crossing point leads to an easier analysis, and betternumerical behavior (due principally to errors in the location of thezero crossing point). The only error introduced by using the exactmid-point is that a small section of each of the above integrals ismultiplied by the wrong gain (1 instead of 1+ε_(G) and vice versa).However, these errors are of order Z_(o) ²ε_(G) and are considerednegligible.

Using computer algebra and assuming small Z_(o) and ε_(G), first orderestimates for the integrals may be derived as:

${I_{1{Ps\_ est}} = {A_{1} + {\frac{4}{\pi}{Z_{0}\left\lbrack {1 + {\frac{2}{3}\frac{A_{2}}{A_{1}}} + {\frac{4}{15}\frac{A_{4}}{A_{1}}}} \right\rbrack}}}},{and}$$I_{1{Ns\_ est}} = {{\left( {1 + ɛ_{G}} \right)\left\lbrack {A_{1} - {\frac{4}{\pi}{Z_{0}\left\lbrack {1 + {\frac{2}{3}\frac{A_{2}}{A_{1}}} + {\frac{4}{15}\frac{A_{4}}{A_{1}}}} \right\rbrack}}} \right\rbrack}.}$

Useful related functions including the sum, difference, and ratio of theintegrals and their estimates may be determined. The sum of theintegrals may be expressed as:Sum_(1s)=(I _(1Ps) +I _(1Ns)),while the sum of the estimates equals:

${Sum}_{1{s\_ est}} = {{A_{1}\left( {2 + ɛ_{G}} \right)} - {\frac{4}{\pi}Z_{0}{{ɛ_{G}\left\lbrack {1 + {\frac{2}{3}\frac{A_{2}}{A_{1}}} + {\frac{4}{15}\frac{A_{4}}{A_{1}}}} \right\rbrack}.}}}$Similarly, the difference of the integrals may be expressed as:Diff_(1s) =I _(1Ps) −I _(1Ns),while the difference of the estimates is:

${Diff}_{1{s\_ est}} = {{A_{1}ɛ_{G}} + {\frac{4}{\pi}{{{Z_{0}\left( {2 + ɛ_{G}} \right)}\left\lbrack {1 + {\frac{2}{3}\frac{A_{2}}{A_{1}}} + {\frac{4}{15}\frac{A_{4}}{A_{1}}}} \right\rbrack}.}}}$Finally, the ratio of the integrals is:

${{Ratio}_{1s} = \frac{I_{1{Ps}}}{I_{1{Ns}}}},$while the ratio of the estimates is:

${Ratio}_{1{s\_ est}} = {{\frac{1}{1 + ɛ_{G}}\left\lbrack {1 + {Z_{0}\left\lbrack {\frac{8}{15}\frac{{15A_{1}} + {10A_{2}} + {4A_{4}}}{\pi\; A_{1}^{2}}} \right\rbrack}} \right\rbrack}.}$

Corresponding cosine integrals are defined as:

${I_{1{Pc}} = {\frac{2\omega}{\pi}{\int_{t_{Z_{0}}}^{\frac{\pi}{\omega} + t_{Z_{0}}}{\left( {{{SV}(t)} + Z_{0}} \right){\cos\ \left\lbrack {\omega\left( {t - t_{z_{0}}} \right)} \right\rbrack}{\mathbb{d}t}}}}},{and}$${I_{1{Nc}} = {\frac{2\omega}{\pi}\left( {1 + ɛ_{G}} \right){\int_{\frac{\pi}{\omega} + t_{Z_{0}}}^{\frac{2\pi}{\omega} + t_{Z_{0}}}{\left( {{{SV}(t)} + Z_{0}} \right){\cos\left\lbrack {\omega\left( {t - t_{z_{0}}} \right)} \right\rbrack}\ {\mathbb{d}t}}}}},$with estimates:

${I_{1{Pc\_ est}} = {{- Z_{0}} + \frac{{40A_{2}} + {16A_{4}}}{15\pi}}},{and}$${I_{1{Nc\_ est}} = {\left( {1 + ɛ_{G}} \right)\left\lbrack {Z_{0} + \frac{{40A_{2}} + {16A_{4}}}{15\pi}} \right\rbrack}},$and sums:

Sum_(1C) = I_(1Pc) + I_(1Nc), and${Sum}_{1{C\_ est}} = {{ɛ_{G}\left\lbrack {Z_{0} + \frac{{40A_{2}} + {16A_{4}}}{15\pi}} \right\rbrack}.}$

Second harmonic integrals are:

${I_{2{Ps}} = {\frac{2\omega}{\pi}{\int_{t_{z_{0}}}^{\frac{\pi}{\omega} + t_{z_{0}}}{\left( {{{SV}(t)} + Z_{0}} \right){\sin\left\lbrack {2{\omega\left( {t - t_{z_{0}}} \right)}} \right\rbrack}\ {\mathbb{d}t}}}}},{and}$$I_{2{Ns}} = {\frac{2\omega}{\pi}\left( {1 + ɛ_{G}} \right){\int_{\frac{\pi}{\omega} + t_{z_{0}}}^{\frac{2\pi}{\omega} + t_{z_{0}}}\left( {{{{SV}(t)} + {Z_{o}{\sin\left\lbrack {2{\omega\left( {t - t_{z_{0}}} \right)}} \right\rbrack}\ {\mathbb{d}t}}},} \right.}}$with estimates:

${I_{2{Ps\_ est}} = {A_{2} + {\frac{8}{15\pi}{Z_{0}\left\lbrack {{- 5} + {9\frac{A_{3}}{A_{1}}}} \right\rbrack}}}},{and}$${I_{2{Ps\_ est}} = {\left( {1 + ɛ_{G}} \right)\left\lbrack {A_{2} - {\frac{8}{15\pi}{Z_{0}\left\lbrack {{- 5} + {9\frac{A_{3}}{A_{1}}}} \right\rbrack}}} \right\rbrack}},$and sums:

Sum_(2s) = I_(2Ps) + I_(2Ns), and${Sum}_{2{Ps\_ est}} = {{A_{2}\left( {2 + ɛ_{G}} \right)} - {\frac{8}{15\pi}ɛ_{G}{{Z_{0}\left\lbrack {{- 5} + {9\frac{A_{3}}{A_{1}}}} \right\rbrack}.}}}$

The integrals can be calculated numerically every cycle. As discussedbelow, the equations estimating the values of the integrals in terms ofvarious amplitudes and the zero offset and gain values are rearranged togive estimates of the zero offset and gain terms based on the calculatedintegrals.

2. Example

The accuracy of the estimation equations may be illustrated with anexample. For each basic integral, three values are provided: the “true”value of the integral (calculated within Mathcad using Rombergintegration), the value using the estimation equation, and the valuecalculated by the digital transmitter operating in simulation mode,using Simpson's method with end correction.

Thus, for example, the value for I_(1Ps) calculated according to:

$I_{1{Ps}} = {\frac{2\omega}{\pi}{\int_{t_{z_{0}}}^{\frac{\pi}{\omega} + t_{z_{0}}}{\left( {{{SV}(t)} + Z_{0}} \right){\sin\left\lbrack {\omega\left( {t - t_{z_{0}}} \right)} \right\rbrack}\;{\mathbb{d}t}}}}$is 0.101353, while the estimated value (I_(1Ps est)) calculated as:

$I_{1{Ps\_ est}} = {A_{1} + {\frac{4}{\pi}{Z_{0}\left\lbrack {1 + {\frac{2}{3}\frac{A_{2}}{A_{1}}} + {\frac{4}{15}\frac{A_{4}}{A_{1}}}} \right\rbrack}}}$is 0.101358. The value calculated using the digital transmitter insimulation mode is 0.101340. These calculations use the parameter valuesillustrated in Table C.

TABLE C Parameter Value Comment ω 160π   This corresponds to frequency =80 Hz, a typical value. A₁ 0.1 This more typically is 0.3, but it couldbe smaller with aeration. A₂  0.01 This more typically is 0.005, but itcould be larger with aeration. A₃ and A₄ 0.0 The digital Coriolissimulation mode only offers two harmonics, so these higher harmonics areignored. However, they are small (<0.002). Z_(o)  0.001 Experiencesuggests that this is a large value for zero offset. ε_(G)  0.001Experience suggests this is a large value for gain mismatch.The exact, estimate and simulation results from using these parametervalues are illustrated in Table D.

TABLE D Integral ‘Exact’ Value Estimate Digital Coriolis SimulationI_(1Ps) 0.101353 0.101358 0.101340 I_(1Ns) 0.098735 0.098740 0.098751I_(1Pc) 0.007487 0.007488 0.007500 I_(1Nc) −0.009496 −0.009498 −0.009531I_(2Ps) 0.009149 0.009151 0.009118 I_(2Ns) 0.010857 0.010859 0.010885

Thus, at least for the particular values selected, the estimates givenby the first order equations are extremely accurate. As Z_(o) and ε_(G)approach zero, the errors in both the estimate and the simulationapproach zero.

3. Implementation

The first order estimates for the integrals define a series ofnon-linear equations in terms of the amplitudes of the harmonics, thezero offset, and the gain mismatch. As the equations are non-linear, anexact solution is not readily available. However, an approximationfollowed by corrective iterations provides reasonable convergence withlimited computational overhead.

Conduit-specific ratios may be assumed for A₁-A₄. As such, no attempt ismade to calculate all of the amplitudes A₁-A₄. Instead, only A₁ and A₂are estimated using the integral equations defined above. Based onexperience of the relative amplitudes, A₃ may be approximated as A₂/2,and A₄ may be approximated as A₂/10.

The zero offset compensation technique may be implemented according tothe procedure 2200 illustrated in FIG. 22. During each cycle, thecontroller calculates the integrals I_(1Ps), I_(1Ns), I_(1Pc), I_(1Nc),I_(2Ps), I_(2Ns) and related functions sum_(1s), ratio_(1s), sum_(1c)and sum_(2s) (step 2205). This requires minimal additional calculationbeyond the conventional Fourier calculations used to determinefrequency, amplitude and phase.

Every 10,000 cycles, the controller checks on the slope of the sensorvoltage amplitude A₁, using a conventional rate-of-change estimationtechnique (step 2210). If the amplitude is constant (step 2215), thenthe controller proceeds with calculations for zero offset and gainmismatch. This check may be extended to test for frequency stability.

To perform the calculations, the controller generates average values forthe functions (e.g., sum_(1s)) over the last 10,000 cycles. Thecontroller then makes a first estimation of zero offset and gainmismatch (step 2225):Z ₀=−Sum_(1c)/2, andε_(G)=1/Ratio_(1s)−1

Using these values, the controller calculates an inverse gain factor (k)and amplitude factor (amp_factor) (step 2230):k=1.0/(1.0+0.5*ε_(G)), andamp_factor=1+50/75*Sum_(2s)/Sum_(1s)The controller uses the inverse gain factor and amplitude factor to makea first estimation of the amplitudes (step 2235):A ₁ =k*[Sum_(1s)/2+2/π*Z _(o)*ε_(G)*amp_factor], andA ₂ =k*[Sum_(2s)/2−4/(3*π)*Z _(o)*ε_(G)

The controller then improves the estimate by the following calculations,iterating as required (step 2240):x₁=Z_(o),x₂=ε_(G),ε_(G)=[1+8/π*x ₁ /A ₁*amp_factor]/Ratio_(1s)−1.0,Z _(o)=−Sum_(1c)/2+x ₂*(x ₁+2.773/π*A ₂)/2,A ₁ =k*[Sum_(1s)/2+2/π*x ₁ *x ₂*amp_factor],A ₂ =k*[Sum _(2s)/2−4/(15*π)*x ₁ *x ₂*(5−4.5*A ₂)].The controller uses standard techniques to test for convergence of thevalues of Z_(o) and ε_(G). In practice the corrections are small afterthe first iteration, and experience suggests that three iterations areadequate.

Finally, the controller adjusts the raw data to eliminate Z_(o) andε_(G) (step 2245). The controller then repeats the procedure. Once zerooffset and gain mismatch have been eliminated from the raw data, thefunctions (i.e., sum_(1s)) used in generating subsequent values forZ_(o) and ε_(G) are based on corrected data. Accordingly, thesesubsequent values for Z_(o) and ε_(G) reflect residual zero offset andgain mismatch, and are summed with previously generated values toproduce the actual zero offset and gain mismatch. In one approach toadjusting the raw data, the controller generates adjustment parameters(e.g., S1_off and S2_off) that are used in converting the analog signalsfrom the sensors to digital data.

FIGS. 23A-23C, 24A and 24B show results obtained using the procedure2200. The short-term behavior is illustrated in FIGS. 23A-23C. Thisshows consecutive phase estimates obtained five minutes after startup toallow time for the procedure to begin affecting the output. Phase isshown based on positive zero-crossings, negative zero-crossings, andboth.

The difference between the positive and negative mean values has beenreduced by a factor of 20, with a corresponding reduction in mean zerooffset in the interleaved data set. The corresponding standard deviationhas been reduced by a factor of approximately 6.

Longer term behavior is shown in FIGS. 24A and 24B. The initial largezero offset is rapidly corrected, and then the phase offset is keptclose to zero over many hours. The average phase offset, excluding thefirst few values, is 6.14e⁻⁶, which strongly suggests that the procedureis successful in compensating for changes in voltage offset and gainimbalance.

Typical values for Z_(o) and ε_(G) for the digital Coriolis meter areZ₀=−7.923e⁻⁴ and ε_(G)=−1.754e⁻⁵ for signal SV₁, and Z_(o)=−8.038e⁻⁴ andε_(G)=+6.93e⁻⁴ for signal SV₂.

H. Dynamic Analysis

In general, conventional measurement calculations for Coriolis metersassume that the frequency and amplitude of oscillation on each side ofthe conduit are constant, and that the frequency on each side of theconduit is identical and equal to the so-called resonant frequency.Phases generally are not measured separately for each side of theconduit, and the phase difference between the two sides is assumed to beconstant for the duration of the measurement process. Precisemeasurements of frequency, phase and amplitude every half-cycle usingthe digital meter demonstrate that these assumptions are only valid whenparameter values are averaged over a time period on the order ofseconds. Viewed at 100 Hz or higher frequencies, these parametersexhibit considerable variation. For example, during normal operation,the frequency and amplitude values of SV₁ may exhibit strong negativecorrelation with the corresponding SV₂ values. Accordingly, conventionalmeasurement algorithms are subject to noise attributable to thesedynamic variations. The noise becomes more significant as themeasurement calculation rate increases. Other noise terms may beintroduced by physical factors, such as flowtube dynamics, dynamicnon-linearities (e.g. flowtube stiffness varying with amplitude), or thedynamic consequences of the sensor voltages providing velocity datarather than absolute position data.

The described techniques exploit the high precision of the digital meterto monitor and compensate for dynamic conduit behavior to reduce noiseso as to provide more precise measurements of process variables such asmass flow and density. This is achieved by monitoring and compensatingfor such effects as the rates of change of frequency, phase andamplitude, flowtube dynamics, and dynamic physical non-idealities. Aphase difference calculation which does not assume the same frequency oneach side has already been described above. Other compensationtechniques are described below.

Monitoring and compensation for dynamic effects may take place at theindividual sensor level to provide corrected estimates of phase,frequency, amplitude or other parameters. Further compensation may alsotake place at the conduit level, where data from both sensors arecombined, for example in the calculation of phase difference and averagefrequency. These two levels may be used together to providecomprehensive compensation.

Thus, instantaneous mass flow and density measurements by the flowmetermay be improved by modelling and accounting for dynamic effects offlowmeter operation. In general, 80% or more of phase noise in aCoriolis flowmeter may be attributed to flowtube dynamics (sometimesreferred to as “ringing”), rather than to process conditions beingmeasured. The application of a dynamic model can reduce phase noise by afactor of 4 to 10, leading to significantly improved flow measurementperformance. A single model is effective for all flow rates andamplitudes of oscillation. Generally, computational requirements arenegligible.

The dynamic analysis may be performed on each of the sensor signals inisolation from the other. This avoids, or at least delays, modelling thedynamic interaction between the two sides of the conduit, which islikely to be far more complex than the dynamics at each sensor. Also,analyzing the individual sensor signals is more likely to be successfulin circumstances such as batch startup and aeration where the two sidesof the conduit are subject to different forces from the process fluid.

In general, the dynamic analysis considers the impact of time-varyingamplitude, frequency and phase on the calculated values for theseparameters. While the frequency and amplitude are easily defined for theindividual sensor voltages, phase is conventionally defined in terms ofthe difference between the sensor voltages. However, when a Fourieranalysis is used, phase for the individual sensor may be defined interms of the difference between the midpoint of the cycle and theaverage 180° phase point.

Three types of dynamic effects are measurement error and the so-called“feedback” and “velocity” effects. Measurement error results because thealgorithms for calculating amplitude and phase assume that frequency,amplitude, and phase are constant over the time interval of interest.Performance of the measurement algorithms may be improved by correctingfor variations in these parameters.

The feedback effect results from supplying energy to the conduit to makeup for energy loss from the conduit so as to maintain a constantamplitude of oscillation. The need to add energy to the conduit is onlyrecognized after the amplitude of oscillation begins to deviate from adesired setpoint. As a result, the damping term in the equation ofmotion for the oscillating conduit is not zero, and, instead, constantlydithers around zero. Although the natural frequency of the conduit doesnot change, it is obscured by shifts in the zero-crossings (i.e., phasevariations) associated with these small changes in amplitude.

The velocity effect results because the sensor voltages observe conduitvelocity, but are analyzed as being representative of conduit position.A consequence of this is that the rate of change of amplitude has animpact on the apparent frequency and phase, even if the true values ofthese parameters are constant.

1. Sensor-Level Compensation for Amplitude Modulation

One approach to correcting for dynamic effects monitors the amplitudesof the sensor signals and makes adjustments based on variations in theamplitudes. For purposes of analyzing dynamic effects, it is assumedthat estimates of phase, frequency and amplitude may be determined foreach sensor voltage during each cycle. As shown in FIG. 25, calculationsare based on complete but overlapping cycles. Each cycle starts at azero crossing point, halfway through the previous cycle. Positive cyclesbegin with positive voltages immediately after the initialzero-crossing, while negative cycles begin with negative voltages. Thuscycle n is positive, while cycles n−1 and n+1 are negative. It isassumed that zero offset correction has been performed so that zerooffset is negligible. It also is assumed that higher harmonics may bepresent.

Linear variation in amplitude, frequency, and phase are assumed. Underthis assumption, the average value of each parameter during a cycleequals the instantaneous value of the parameter at the mid-point of thecycle. Since the cycles overlap by 180 degrees, the average value for acycle equals the starting value for the next cycle.

For example, cycle n is from time 0 to 2π/ω. The average values ofamplitude, frequency and phase equal the instantaneous values at themid-point, π/ω, which is also the starting point for cycle n+1, which isfrom time π/ω to 3π/ω. Of course, these timings are approximate, since walso varies with time.

a. Dynamic Effect Compensation Procedure

The controller accounts for dynamic effects according to the procedure2600 illustrated in FIG. 26. First, the controller produces a frequencyestimate (step 2605) by using the zero crossings to measure the timebetween the start and end of the cycle, as described above. Assumingthat frequency varies linearly, this estimate equals the time-averagedfrequency over the period.

The controller then uses the estimated frequency to generate a firstestimate of amplitude and phase using the Fourier method described above(step 2610). As noted above, this method eliminates the effects ofhigher harmonics.

Phase is interpreted in the context of a single waveform as being thedifference between the start of the cycle (i.e., the zero-crossingpoint) and the point of zero phase for the component of SV(t) offrequency w, expressed as a phase offset. Since the phase offset is anaverage over the entire waveform, it may be used as the phase offsetfrom the midpoint of the cycle. Ideally, with no zero offset andconstant amplitude of oscillation, the phase offset should be zero everycycle. In practice, however, it shows a high level of variation andprovides an excellent basis for correcting mass flow to account fordynamic changes in amplitude.

The controller then calculates a phase difference (step 2615). Though anumber of definitions of phase difference are possible, the analysisassumes that the average phase and frequency of each sensor signal isrepresentative of the entire waveform. Since these frequencies aredifferent for SV₁ and SV₂, the corresponding phases are scaled to theaverage frequency. In addition, the phases are shifted to the samestarting point (i.e., the midpoint of the cycle on SV₁). After scaling,they are subtracted to provide the phase difference.

The controller next determines the rate of change of the amplitude forthe cycle n (step 2620):

$\begin{matrix}{{roc\_ amp}_{n} \approx \frac{{{amp}\left( {{end}\mspace{14mu}{of}\mspace{14mu}{cycle}} \right)} - {{amp}\left( {{start}\mspace{14mu}{of}\mspace{14mu}{cycle}} \right)}}{{period}\mspace{14mu}{of}\mspace{14mu}{cycle}}} \\{= {\left( {{amp}_{n + 1} - {amp}_{n - 1}} \right){{freq}_{n}.}}}\end{matrix}$This calculation assumes that the amplitude from cycle n+1 is availablewhen calculating the rate of change of cycle n. This is possible if thecorrections are made one cycle after the raw amplitude calculations havebeen made. The advantage of having an accurate estimate of the rate ofchange, and hence good measurement correction, outweighs the delay inthe provision of the corrected measurements, which, in oneimplementation, is on the order of 5 milliseconds. The most recentlygenerated information is always used for control of the conduit (i.e.,for generation of the drive signal).

If desired, a revised estimate of the rate of change can be calculatedafter amplitude correction has been applied (as described below). Thisresults in iteration to convergence for the best values of amplitude andrate of change.

b. Frequency Compensation for Feedback and Velocity Effects

As noted above, the dynamic aspects of the feedback loop introduce timevarying shifts in the phase due to the small deviations in amplitudeabout the set-point. This results in the measured frequency, which isbased on zero-crossings, differing from the natural frequency of theconduit. If velocity sensors are used, an additional shift in phaseoccurs. This additional shift is also associated with changes in thepositional amplitude of the conduit. A dynamic analysis can monitor andcompensate for these effects. Accordingly, the controller uses thecalculated rate of amplitude change to correct the frequency estimate(step 2625).

The position of an oscillating conduit in a feedback loop that isemployed to maintain the amplitude of oscillation of the conduitconstant may be expressed as:X=A(t)sin(ω₀ t−θ(t)),where θ(t) is the phase delay caused by the feedback effect. Themechanical Q of the oscillating conduit is typically on the order of1000, which implies small deviations in amplitude and phase. Under theseconditions, e(t) is given by:

${\theta(t)} \approx {- {\frac{\overset{.}{A}(t)}{2\omega_{0}{A(t)}}.}}$Since each sensor measures velocity:

$\begin{matrix}{{{SV}(t)} = {\overset{.}{X}(t)}} \\{= {{{\overset{.}{A}(t)}{\sin\left\lbrack {{\omega_{0}t} - {\theta(t)}} \right\rbrack}} + {\left\lbrack {\omega_{0} - {\overset{.}{\theta}(t)}} \right\rbrack{A(t)}{\cos\left\lbrack {{\omega_{0}t} - {\theta(t)}} \right\rbrack}}}} \\{{= {\omega_{0}{{A(t)}\left\lbrack {\left( {1 - \frac{\theta}{\omega_{0}}} \right)^{2} + \left( \frac{\overset{.}{A}(t)}{\omega_{0}{A(t)}} \right)^{2}} \right\rbrack}^{1/2}{\cos\left( {{\omega_{0}t} - {\theta(t)} - {\gamma(t)}} \right)}}},}\end{matrix}$where γ(t) is the phase delay caused by the velocity effect:

${\gamma(t)} = {{\tan^{- 1}\left( \frac{\overset{.}{A}(t)}{\omega_{0}{A(t)}\left( {1 - \frac{\overset{.}{\theta}}{\omega_{0}}} \right)} \right)}.}$Since the mechanical Q of the conduit is typically on the order of 1000,and, hence, variations in amplitude and phase are small, it isreasonable to assume:

$\frac{\overset{.}{\theta}}{\omega_{0}}{\operatorname{<<}1}\mspace{14mu}{and}\mspace{14mu}\frac{\overset{.}{A}(t)}{\omega_{0}{A(t)}}{\operatorname{<<}1.}$This means that the expression for SV(t) may be simplified to:SV(t)≈ω₀A(t)cos(ω₀t−θ(t)−γ(t)),and for the same reasons, the expression for the velocity offset phasedelay may be simplified to:

${\gamma(t)} \approx {\frac{\overset{.}{A}(t)}{\omega_{0}{A(t)}}.}$Summing the feedback and velocity effect phase delays gives the totalphase delay:

${{\varphi(t)} = {{{{\theta(t)} + {\gamma(t)}} \approx {{- \frac{\overset{.}{A}(t)}{2\omega_{0}{A(t)}}} + \frac{\overset{.}{A}(t)}{w_{0}{A(t)}}}} = \frac{\overset{.}{A}(t)}{2\omega_{0}{A(t)}}}},$and the following expression for SV(t):SV(t)≈ω₀A(t)cos [ω₀t−φ(t)].

From this, the actual frequency of oscillation may be distinguished fromthe natural frequency of oscillation. Though the former is observed, thelatter is useful for density calculations. Over any reasonable length oftime, and assuming adequate amplitude control, the averages of these twofrequencies are the same (because the average rate of change ofamplitude must be zero). However, for improved instantaneous densitymeasurement, it is desirable to compensate the actual frequency ofoscillation for dynamic effects to obtain the natural frequency. This isparticularly useful in dealing with aerated fluids for which theinstantaneous density can vary rapidly with time.

The apparent frequency observed for cycle n is delineated by zerocrossings occurring at the midpoints of cycles n−1 and n+1. The phasedelay due to velocity change will have an impact on the apparent startand end of the cycle:

$\begin{matrix}{{obs\_ freq}_{n} = {{obs\_ freq}_{n - 1} + {\frac{{true\_ freq}_{n}}{2\pi}\left( {\varphi_{n + 1} - \varphi_{n - 1}} \right)}}} \\{= {{obs\_ freq}_{n - 1} + \frac{{true\_ freq}_{n - 1}}{2\pi}}} \\{\left( {\frac{{\overset{.}{A}}_{n + 1}}{4\pi\;{true\_ freq}_{n}A_{n + 1}} - \frac{{\overset{.}{A}}_{n - 1}}{4\pi\;{true\_ freq}_{n}A_{n - 1}}} \right)} \\{= {{obs\_ freq}_{n - 1} + {\frac{1}{8\pi^{2}}{\left( {\frac{{\overset{.}{A}}_{n + 1}}{A_{n + 1}} - \frac{{\overset{.}{A}}_{n - 1}}{A_{n - 1}}} \right).}}}}\end{matrix}$Based on this analysis, a correction can be applied using an integratederror term:

${{error\_ sum}_{n} = {{error\_ sum}_{n - 1} - {\frac{1}{8\pi^{2}}\left( {\frac{{\overset{.}{A}}_{n + 1}}{A_{n + 1}} - \frac{{\overset{.}{A}}_{n - 1}}{A_{n - 1}}} \right)}}},{and}$est_freq_(n) = obs_freq_(n) − error_sum_(n),where the value of error sum at startup (i.e., the value at cycle zero)is:

${error\_ sum}_{0} = {{- \frac{1}{8\pi^{2}}}{\left( {\frac{{\overset{.}{A}}_{0}}{A_{0}} + \frac{{\overset{.}{A}}_{1}}{A_{1}}} \right).}}$Though these equations include a constant term having a value of ⅛π²,actual data has indicated that a constant term of ⅛π is moreappropriate. This discrepancy may be due to unmodelled dynamics that maybe resolved through further analysis.

The calculations discussed above assume that the true amplitude ofoscillation, A, is available. However, in practice, only the sensorvoltage SV is observed. This sensor voltage may be expressed as:SV(t)≈ω₀{dot over (A)}(t)cos(ω₀t−φ(t))The amplitude, amp_SV(t), of this expression is:amp_SV(t)≈ω₀{dot over (A)}(t).The rate of change of this amplitude is:roc_amp_SV(t)≈ω₀{dot over (A)}(t)so that the following estimation can be used:

$\frac{\overset{.}{A}(t)}{A(t)} \approx {\frac{{roc\_ amp}{\_ SV}(t)}{{amp\_ SV}(t)}.}$

c. Application of Feedback and Velocity Effect Frequency Compensation

FIGS. 27A-32B illustrate how application of the procedure 2600 improvesthe estimate of the natural frequency, and hence the process density,for real data from a meter having a one inch diameter conduit. Each ofthe figures shows 10,000 samples, which are collected in just over 1minute.

FIGS. 27A and 27B show amplitude and frequency data from SV₁, taken whenrandom changes to the amplitude set-point have been applied. Since theconduit is full of water and there is no flow, the natural frequency isconstant. However, the observed frequency varies considerably inresponse to changes in amplitude. The mean frequency value is 81.41 Hz,with a standard deviation of 0.057 Hz.

FIGS. 28A and 28B show, respectively, the variation in frequency fromthe mean value, and the correction term generated using the procedure2600. The gross deviations are extremely well matched. However, there isadditional variance in frequency which is not attributable to amplitudevariation. Another important feature illustrated by FIG. 28B is that theaverage is close to zero as a result of the proper initialization of theerror term, as described above.

FIGS. 29A and 92B compare the raw frequency data (FIG. 29A) with theresults of applying the correction function (FIG. 29B). There has been anegligible shift in the mean frequency, while the standard deviation hasbeen reduced by a factor of 4.4. From FIG. 29B, it is apparent thatthere is residual structure in the corrected frequency data. It isexpected that further analysis, based on the change in phase across acycle and its impact on the observed frequency, will yield further noisereductions.

FIGS. 30A and 30B show the corresponding effect on the averagefrequency, which is the mean of the instantaneous sensor voltagefrequencies. Since the mean frequency is used to calculate the densityof the process fluid, the noise reduction (here by a factor of 5.2) willbe propagated into the calculation of density.

FIGS. 31A and 31B illustrate the raw and corrected average frequency fora 2″ diameter conduit subject to a random amplitude set-point. The 2″flowtube exhibits less frequency variation that the 1″, for both raw andcorrected data. The noise reduction factor is 4.0.

FIGS. 32A and 32B show more typical results with real flow data for theone inch flowtube. The random setpoint algorithm has been replaced bythe normal constant setpoint. As a result, there is less amplitudevariation than in the previous examples, which results in a smallernoise reduction factor of 1.5.

d. Compensation of Phase Measurement for Amplitude Modulation

Referring again to FIG. 26, the controller next compensates the phasemeasurement to account for amplitude modulation assuming the phasecalculation provided above (step 2630). The Fourier calculations ofphase described above assume that the amplitude of oscillation isconstant throughout the cycle of data on which the calculations takeplace. This section describes a correction which assumes a linearvariation in amplitude over the cycle of data.

Ignoring higher harmonics, and assuming that any zero offset has beeneliminated, the expression for the sensor voltage is given by:SV(t)≈A₁(1+λ_(A)t)sin(ωt)where λ_(A) is a constant corresponding to the relative change inamplitude with time. As discussed above, the integrals I₁ and I₂ may beexpressed as:

${I_{1} = {\frac{2\omega}{\pi}{\int_{0}^{\frac{2\pi}{\omega}}{{{SV}(t)}{\sin\left( {\omega\; t} \right)}{\mathbb{d}t}}}}},{and}$$I_{2} = {\frac{2\omega}{\pi}{\int_{0}^{\frac{2\pi}{\omega}}{{{SV}(t)}{\cos\left( {\omega\; t} \right)}{{\mathbb{d}t}.}}}}$Evaluating these integrals results in

${I_{1} = {A_{1}\left( {1 + {\frac{\pi}{\omega}\lambda_{A}}} \right)}},{and}$$I_{2} = {A_{1}\frac{1}{2\omega}{\lambda_{A}.}}$Substituting these expressions into the calculation for amplitude andexpanding as a series in λ_(A) results in:

${Amp} = {{A_{1}\left( {1 + {\frac{\pi}{\omega}\lambda_{A}} + {\frac{1}{8\omega^{2}}\lambda_{A}^{2}} + \ldots} \right)}.}$

Assuming λ_(A) is small, and ignoring all terms after the first orderterm, this may be simplified to:

${Amp} = {{A_{1}\left( {1 + {\frac{\pi}{\omega}\lambda_{A}}} \right)}.}$This equals the amplitude of SV(t) at the midpoint of the cycle (t=π/ω).Accordingly, the amplitude calculation provides the required resultwithout correction.

For the phase calculation, it is assumed that the true phase differenceand frequency are constant, and that there is no voltage offset, whichmeans that the phase value should be zero. However, as a result ofamplitude modulation, the correction to be applied to the raw phase datato compensate for amplitude modulation is:

${Phase} = {{\tan^{- 1}\left( \frac{\lambda_{A}}{2\left( {{\pi\lambda}_{A} + \omega} \right)} \right)}.}$Assuming that the expression in brackets is small, the inverse tangentfunction can be ignored.

A more elaborate analysis considers the effects of higher harmonics.Assuming that the sensor voltage may be expressed as:SV(t)=(1+λ_(A) t)[A ₁ sin(ωt)+A ₂ sin(2ωt)+A ₃ sin(ωt)+A ₄ sin(4ωt)]such that all harmonic amplitudes increase at the same relative rateover the cycle, then the resulting integrals may be expressed as:

${I_{1} = {A_{1}\left( {1 + {\frac{\pi}{\omega}\lambda_{A}}} \right)}},{and}$$I_{2}\frac{- 1}{60\omega}{\lambda_{A}\left( {{30\; A_{1}} + {80\; A_{2}} + {45A_{3}} + {32A_{4}}} \right)}$for positive cycles, and

$I_{2}\frac{- 1}{60\omega}{\lambda_{A}\left( {{30\; A_{1}} + {80\; A_{2}} + {45A_{3}} + {32A_{4}}} \right)}$for negative cycles.

For amplitude, substituting these expressions into the calculationsestablishes that the amplitude calculation is only affected in thesecond order and higher terms, so that no correction is necessary to afirst order approximation of the amplitude. For phase, the correctionterm becomes:

$\frac{- 1}{60}{\lambda_{A}\left( \frac{{30\; A_{1}} + {80\; A_{2}} + {45A_{3}} + {32A_{4}}}{A_{1}\left( {{\pi\lambda}_{A} + \omega} \right)} \right)}$for positive cycles, and

$\frac{- 1}{60}{\lambda_{A}\left( \frac{{30\; A_{1}} - {80\; A_{2}} + {45A_{3}} - {32A_{4}}}{A_{1}\left( {{\pi\lambda}_{A} + \omega} \right)} \right)}$for negative cycles. These correction terms assume the availability ofthe amplitudes of the higher harmonics. While these can be calculatedusing the usual Fourier technique, it is also possible to approximatesome or all them using assumed ratios between the harmonics. Forexample, for one implementation of a one inch diameter conduit, typicalamplitude ratios are A₁=1.0, A₂=0.01, A₃=0.005, and A₄=0.001.

e. Application of Amplitude Modulation Compensation to Phase

Simulations have been carried out using the digital transmitter,including the simulation of higher harmonics and amplitude modulation.One example uses f=80 Hz, A₁(t=0)=0.3, A₂=0, A₃=0, A₄=0, λ_(A)=1e⁻⁵*48KHz (sampling rate)=0.47622, which corresponds to a high rate of changeof amplitude, but with no higher harmonics. Theory suggests a phaseoffset of −0.02706 degrees. In simulation over 1000 cycles, the averageoffset is −0.02714 degrees, with a standard deviation of only 2.17e⁻⁶.The difference between simulation and theory (approx 0.3% of thesimulation error) is attributable to the model's assumption of a linearvariation in amplitude over each cycle, while the simulation generatesan exponential change in amplitude.

A second example includes a second harmonic, and has the parameters f=80Hz, A₁(t=0)=0.3, A₂(t=0)=0.003, A₃=0, A₄=0, λ_(A)=−1e⁻⁶*48 KHz (samplingrate)=−0.047622. For this example, theory predicts the phase offset tobe +2.706e⁻³, +/−2.66% for positive or negative cycles. In simulation,the results are 2.714e⁻³+/−2.66%, which again matches well.

FIGS. 33A-34B give examples of how this correction improves realflowmeter data. FIG. 33A shows raw phase data from SV₁, collected from a1″ diameter conduit, with low flow assumed to be reasonably constant.FIG. 33B shows the correction factor calculated using the formuladescribed above, while FIG. 33C shows the resulting corrected phase. Themost apparent feature is that the correction has increased the varianceof the phase signal, while still producing an overall reduction in thephase difference (i.e., SV₂−SV₁) standard deviation by a factor of 1.26,as shown in FIGS. 34A and 34B. The improved performance results becausethis correction improves the correlation between the two phases, leadingto reduced variation in the phase difference. The technique worksequally well in other flow conditions and on other conduit sizes.

f. Compensation to Phase Measurement for Velocity Effect

The phase measurement calculation is also affected by the velocityeffect. A highly effective and simple correction factor, in radians, isof the form

${{c_{v}\left( t_{k} \right)} = {\frac{1}{\pi}\Delta\;{{SV}\left( t_{k} \right)}}},$where ΔSV(t_(k)) is the relative rate of change of amplitude and may beexpressed as:

${{\Delta\;{{SV}\left( t_{k} \right)}} = {\frac{{{SV}\left( t_{k + 1} \right)} - {{SV}\left( t_{k - 1} \right)}}{t_{k + 1} - t_{k - 1}} \cdot \frac{1}{{SV}\left( t_{k} \right)}}},$where t_(k) is the completion time for the cycle for which ΔSV(t_(k)) isbeing determined, t_(k+1) is the completion time for the next cycle, andt_(k−1) is the completion time of the previous cycle. ΔSV is an estimateof the rate of change of SV, scaled by its absolute value, and is alsoreferred to as the proportional rate of change of SV.

FIGS. 35A-35E illustrate this technique. FIG. 35A shows the raw phasedata from a single sensor (SV₁), after having applied the amplitudemodulation corrections described above. FIG. 35B shows the correctionfactor in degrees calculated using the equation above, while FIG. 35Cshows the resulting corrected phase. It should be noted that thestandard deviation of the corrected phase has actually increasedrelative to the raw data. However, when the corresponding calculationstake place on the other sensor (SV₂), there is an increase in thenegative correlation (from −0.8 to −0.9) between the phases on the twosignals. As a consequence, the phase difference calculations based onthe raw phase measurements (FIG. 35D) have significantly more noise thanthe corrected phase measurements (FIG. 35E).

Comparison of FIGS. 35D and 35E shows the benefits of this noisereduction technique. It is immediately apparent from visual inspectionof FIG. 35E that the process variable is decreasing, and that there aresignificant cycles in the measurement, with the cycles beingattributable, perhaps, to a poorly conditioned pump. None of this isdiscernable from the uncorrected phase difference data of FIG. 35D.

g. Application of Sensor Level Noise Reduction

The combination of phase noise reduction techniques described aboveresults in substantial improvements in instantaneous phase differencemeasurement in a variety of flow conditions, as illustrated in FIGS.36A-36L. Each graph shows three phase difference measurements calculatedsimultaneously in real time by the digital Coriolis transmitteroperating on a one inch conduit. The middle band 3600 shows phase datacalculated using the simple time-difference technique. The outermostband 3605 shows phase data calculated using the Fourier-based techniquedescribed above.

It is perhaps surprising that the Fourier technique, which uses far moredata, a more sophisticated analysis, and much more computational effort,results in a noisier calculation. This can be attributed to thesensitivity of the Fourier technique to the dynamic effects describedabove. The innermost band of data 3610 shows the same Fourier data afterthe application of the sensor-level noise reduction techniques. As canbe seen, substantial noise reduction occurs in each case, as indicatedby the standard deviation values presented on each graph.

FIG. 36A illustrates measurements with no flow, a full conduit, and nopump noise. FIG. 36B illustrates measurements with no flow, a fullconduit, and the pumps on.

FIG. 36C illustrates measurements with an empty, wet conduit. FIG. 36Dillustrates measurements at a low flow rate. FIG. 36E illustratesmeasurements at a high flow rate. FIG. 36F illustrates measurements at ahigh flow rate and an amplitude of oscillation of 0.03V. FIG. 36Gillustrates measurements at a low flow rate with low aeration. FIG. 36Hillustrates measurements at a low flow rate with high aeration. FIG. 36Iillustrates measurements at a high flow rate with low aeration. FIG. 36Jillustrates measurements at a high flow rate with high aeration. FIG.36K illustrates measurements for an empty to high flow rate transition.FIG. 36L illustrates measurements for a high flow rate to emptytransition.

2. Flowtube Level Dynamic Modelling

A dynamic model may be incorporated in two basic stages. In the firststage, the model is created using the techniques of systemidentification. The flowtube is “stimulated” to manifest its dynamics,while the true mass flow and density values are kept constant. Theresponse of the flowtube is measured and used in generating the dynamicmodel. In the second stage, the model is applied to normal flow data.Predictions of the effects of flowtube dynamics are made for both phaseand frequency. The predictions then are subtracted from the observeddata to leave the residual phase and frequency, which should be due tothe process alone. Each stage is described in more detail below.

a. System Identification

System identification begins with a flowtube full of water, with noflow. The amplitude of oscillation, which normally is kept constant, isallowed to vary by assigning a random setpoint between 0.05 V and 0.3 V,where 0.3 V is the usual value. The resulting sensor voltages are shownin FIG. 37A, while FIGS. 37B and 37C show, respectively, thecorresponding calculated phase and frequency values. These values arecalculated once per cycle. Both phase and frequency show a high degreeof “structure.” Since the phase and frequency corresponding to mass floware constant, this structure is likely to be related to flowtubedynamics. Observable variables that will predict this structure when thetrue phase and frequency are not known to be constant may be expressedas set forth below.

First, as noted above, ΔSV(t_(k)) may be expressed as:

${\Delta\;{{SV}\left( t_{k} \right)}} = {\frac{{{SV}\left( t_{k + 1} \right)} - {{SV}\left( t_{k - 1} \right)}}{t_{k + 1} - t_{k - 1}} \cdot {\frac{1}{{SV}\left( t_{k} \right)}.}}$This expression may be used to determine ΔSV₁ and ΔSV₂.

The phase of the flowtube is related to A, which is defined asΔSV₁−ΔSV₂, while the frequency is related to Δ⁺, which is defined asΔSV₁+ΔSV₂. These parameters are illustrated in FIGS. 37D and 37E.Comparing FIG. 37B to FIG. 37D and FIG. 37C to FIG. 37E shows thestriking relationship between Δ⁻ and phase and between Δ⁺ and frequency.

Some correction for flowtube dynamics may be obtained by subtracting amultiple of the appropriate prediction function from the phase and/orthe frequency. Improved results may be obtained using a model of theform:y(k)+a ₁ y(k−1)+ . . . +a _(n) y(k−n)=b ₀ u(k)+b ₁ u(k−1)+ . . . +b _(m)u(k−m),where y(k) is the output (i.e., phase or frequency) and u is theprediction function (i.e., Δ⁻ or Δ⁺). The technique of systemidentification suggests values for the orders n and m, and thecoefficients a_(i) and b_(j), of what are in effect polynomials in time.The value of y(k) can be calculated every cycle and subtracted from theobserved phase or frequency to get the residual process value.

It is important to appreciate that, even in the absence of dynamiccorrections, the digital flowmeter offers very good precision over along period of time. For example, when totalizing a batch of 200 kg, thedevice readily achieves a repeatability of less that 0.03%. The purposeof the dynamic modelling is to improve the dynamic precision. Thus, rawand compensated values should have similar mean values, but reductionsin “variance” or “standard deviation.”

FIGS. 38A and 39A show raw and corrected frequency values. The meanvalues are similar, but the standard deviation has been reduced by afactor of 3.25. Though the gross deviations in frequency have beeneliminated, significant “structure” remains in the residual noise. Thisstructure appears to be unrelated to the Δ⁺ function. The model used isa simple first order model, where m=n=1.

FIGS. 38B and 39B show the corresponding phase correction. The meanvalue is minimally affected, while the standard deviation is reduced bya factor of 7.9. The model orders are n=2 and m=10. Some structureappears to remain in the residual noise. It is expected that thisstructure is due to insufficient excitation of the phase dynamics bysetpoint changes.

More effective phase identification has been achieved through furthersimulation of flowtube dynamics by continuous striking of the flowtubeduring data collection (set point changes are still carried out). FIGS.38C and 39C show the effects of correction under these conditions. Asshown, the standard deviation is reduced by a factor of 31. This moreeffective model is used in the following discussions.

b. Application to Flow Data

The real test of an identified model is the improvements it provides fornew data. At the outset, it is useful to note a number of observations.First, the mean phase, averaged over, for example, ten seconds or more,is already quite precise. In the examples shown, phase values areplotted at 82 Hz or thereabouts. The reported standard deviation wouldbe roughly ⅓ of the values shown when averaged to 10 Hz, and 1/9 whenaverages to 1 Hz. For reference, on a one inch flow tube, one degree ofphase difference corresponds to about 1 kg/s flow rate.

The expected benefit of the technique is that of providing a much betterdynamic response to true process changes, rather than improving averageprecision. Consequently, in the following examples, where the flow isnon-zero, small flow step changes are introduced every ten seconds orso, with the expectation that the corrected phase will show up the stepchanges more clearly.

FIGS. 38D and 39D show the correction applied to a full flowtube withzero flow, just after startup. The ring-down effect characteristic ofstartup is clearly evident in the raw data (FIG. 38D), but this iseliminated by the correction (FIG. 39D), leading to a standard deviationreduction of a factor of 23 over the whole data set. Note that thecorrected measurement closely resembles white noise, suggesting mostflowtube dynamics have been captured.

FIGS. 38E and 39E show the resulting correction for a “drained”flowtube. Noise is reduced by a factor of 6.5 or so. Note, however, thatthere appears to be some residual structure in the noise.

The effects of the technique on low (FIGS. 38F and 39F), medium (FIGS.38G and 39G), and high (FIGS. 38H and 39H) flow rates are alsoillustrated, each with step changes in flow every ten seconds. In eachcase, the pattern is the same: the corrected average flows (FIGS.39F-39H) are identical to the raw average flows (FIGS. 38F-38H), but thedynamic noise is reduced considerably. In FIG. 39H, this leads to theemergence of the step changes which previously had been submerged innoise (FIG. 38H).

3. Extensions of Dynamic Monitoring and Compensation Techniques

The previous sections have described a variety of techniques (physicalmodelling, system identification, heuristics) used to monitor andcompensate for different aspects of dynamic behavior (frequency andphase noise caused by amplitude modulation, velocity effect, flowtubedynamics at both the sensor and the flowtube level). By naturalextension, similar techniques well-known to practitioners of controland/or instrumentation, including those of artificial intelligence,neural networks, fuzzy logic, and genetic algorithms, as well asclassical modelling and identification methods, may be applied to theseand other aspects of the dynamic performance of the meter. Specifically,these might include monitoring and compensation for frequency, amplitudeand/or phase variation at the sensor level, as well as average frequencyand phase difference at the flowtube level, as these variations occurwithin each measurement interval, as well as the time betweenmeasurement intervals (where measurement intervals do not overlap).

This technique is unusual in providing both reduced noise and improveddynamic response to process measurement changes. As such, the techniquepromises to be highly valuable in the context of flow measurement.

I. Aeration (Two-Phase Flow)

The digital flowmeter provides improved performance in the presence ofaeration (also known as two-phase flow) in the conduit. Aeration causesenergy losses in the conduit that can have a substantial negative impacton the measurements produced by a mass flowmeter and can result installing of the conduit. Experiments have shown that the digitalflowmeter has substantially improved performance in the presence ofaeration relative to traditional, analog flowmeters. This performanceimprovement may stem from the meter's ability to provide a very widegain range, to employ negative feedback, to calculate measurementsprecisely at very low amplitude levels, and to compensate for dynamiceffects such as rate of change of amplitude and flowtube dynamics. Theperformance improvement also may stem from the meter's use of a precisedigital amplitude control algorithm.

The digital flowmeter detects the onset of aeration when the requireddriver gain rises simultaneously with a drop in apparent fluid density.The digital flowmeter then may directly respond to detected aeration. Ingeneral, the meter monitors the presence of aeration by comparing theobserved density of the material flowing through the conduit (i.e., thedensity measurement obtained through normal measurement techniques) tothe known, non-aerated density of the material. The controllerdetermines the level of aeration based on any difference between theobserved and actual densities. The controller then corrects the massflow measurement accordingly.

The controller determines the non-aerated density of the material bymonitoring the density over time periods in which aeration is notpresent (i.e., periods in which the density has a stable value).Alternatively, a control system to which the controller is connected mayprovide the non-aerated density as an initialization parameter.

In one implementation, the controller uses three corrections to accountfor the effects of aeration: bubble effect correction, damping effectcorrection, and sensor imbalance correction. FIGS. 40A-40H illustratethe effects of the correction procedure.

FIG. 40A illustrates the error in the phase measurement as the measureddensity decreases (i.e., as aeration increases) for different mass flowrates, absent aeration correction. As shown, the phase error is negativeand has a magnitude that increases with increasing aeration. FIG. 40Billustrates that the resulting mass flow error also is negative. It alsois significant to note that the digital flowmeter operates at highlevels of aeration. By contrast, as indicated by the vertical bar 4000,traditional analog meters tend to stall in the presence of low levels ofaeration.

A stall occurs when the flowmeter is unable to provide a sufficientlylarge driver gain to allow high drive current at low amplitudes ofoscillation. If the level of damping requires a higher driver gain thancan be delivered by the flowtube in order to maintain oscillation at acertain amplitude, then insufficient drive energy is supplied to theconduit. This results in a drop in amplitude of oscillation, which inturn leads to even less drive energy supplied due to the maximum gainlimit. Catastrophic collapse results, and flowtube oscillation is notpossible until the damping reduces to a level at which the correspondingdriver gain requirement can be supplied by the flowmeter.

The bubble effect correction is based on the assumption that the massflow decreases as the level of aeration, also referred to as the voidfraction, increases. Without attempting to predict the actualrelationship between void fraction and the bubble effect, thiscorrection assumes, with good theoretical justification, that the effecton the observed mass flow will be the same as the effect on the observeddensity. Since the true fluid density is known, the bubble effectcorrection corrects the mass flow rate by the same proportion. Thiscorrection is a linear adjustment that is the same for all flow rates.FIGS. 40C and 40D illustrate, respectively, the residual phase and massflow errors after correction for the bubble effect. As shown, theresidual errors are now positive and substantially smaller in magnitudethan the original errors.

The damping factor correction accounts for damping of the conduit motiondue to aeration. In general, the damping factor correction is based onthe following relationship between the observed phase, φ_(obs), and theactual phase, φ_(true):

${\varphi_{obs} = {\varphi_{true}\left( {1 + \frac{k\;\lambda^{2}\varphi_{true}}{f^{2}}} \right)}},$where λ is a damping coefficient and k is a constant. FIG. 40Eillustrates the damping correction for different mass flow rates anddifferent levels of aeration. FIG. 40F illustrates the residual phaseerror after correction for damping. As shown, the phase error is reducedsubstantially relative to the phase error remaining after bubble effectcorrection.

The sensor balance correction is based on density differences betweendifferent ends of the conduit. As shown in FIG. 41, a pressure dropbetween the inlet and the outlet of the conduit results in increasingbubble sizes from the inlet to the outlet. Since material flows seriallythrough the two loops of the conduit, the bubbles at the inlet side ofthe conduit (i.e., the side adjacent to the first sensor/driver pair)will be smaller than the bubbles at the outlet side of the conduit(i.e., the side adjacent to the second sensor/driver pair). Thisdifference in bubble size results in a difference in mass and densitybetween the two ends of the conduit. This difference is reflected in thesensor signals (SV₁ and SV₂). Accordingly, the sensor balance correctionis based on a ratio of the two sensor signals.

FIG. 40G illustrates the sensor balance correction for different massflow rates and different levels of aeration. FIG. 40H illustrates theresidual phase error after applying the sensor balance correction. Atlow flow rates and low levels of aeration, the phase error is improvedrelative to the phase error remaining after damping correction.

Other correction factors also may be used. For example, the phase angleof each sensor signal may be monitored. In general, the average phaseangle for a signal should be zero. However, the average phase angletends to increase with increasing aeration. Accordingly, a correctionfactor could be generated based on the value of the average phase angle.Another correction factor could be based on the temperature of theconduit.

In general, application of the correction factors tends to keep the massflow errors at one percent or less. Moreover, these correction factorsappear to be applicable over a wide range of flows and aeration levels.

J. Setpoint Adjustment

The digital flowmeter provides improved control of the setpoint for theamplitude of oscillation of the conduit. In an analog meter, feedbackcontrol is used to maintain the amplitude of oscillation of the conduitat a fixed level corresponding to a desired peak sensor voltage (e.g.,0.3 V). A stable amplitude of oscillation leads to reduced variance inthe frequency and phase measurements.

In general, a large amplitude of oscillation is desirable, since such alarge amplitude provides a large Coriolis signal for measurementpurposes. A large amplitude of oscillation also results in storage of ahigher level of energy in the conduit, which provides greater robustnessto external vibrations.

Circumstances may arise in which it is not possible to maintain thelarge amplitude of oscillation due to limitations in the current thatcan be supplied to the drivers. For example, in one implementation of ananalog transmitter, the current is limited to 100 mA for safetypurposes. This is typically 5-10 times the current needed to maintainthe desired amplitude of oscillation. However, if the process fluidprovides significant additional damping (e.g., via two-phase flow), thenthe optimal amplitude may no longer be sustainable.

Similarly, a low-power flowmeter, such as the two-wire meter describedbelow, may have much less power available to drive the conduit. Inaddition, the power level may vary when the conduit is driven bycapacitive discharge.

Referring to FIG. 42, a control procedure 4200 implemented by thecontroller of the digital flowmeter may be used to select the highestsustainable setpoint given a maximum available current level. Ingeneral, the procedure is performed each time that a desired drivecurrent output is selected, which typically is once per cycle, or onceevery half-cycle if interleaved cycles are used.

The controller starts by setting the setpoint to a default value (e.g.,0.3 V) and initializing filtered representations of the sensor voltage(filtered_SV) and the drive current (filtered_DC) (step 4205). Each timethat the procedure is performed, the controller updates the filteredvalues based on current values for the sensor voltage (SV) and drivecurrent (DC) (step 4210). For example, the controller may generate a newvalue for filtered_SV as the sum of ninety nine percent of filtered_SVand one percent of SV.

Next, the controller determines whether the procedure has been paused toprovide time for prior setpoint adjustments to take effect (step 4215).Pausing of the procedure is indicated by a pause cycle count having avalue greater than zero. If the procedure is paused, the controllerperforms no further actions for the cycle and decrements the pause cyclecount (step 4220).

If the procedure has not been paused, the controller determines whetherthe filtered drive current exceeds a threshold level (step 4225). In oneimplementation, the threshold level is ninety five percent of themaximum available current. If the current exceeds the threshold, thecontroller reduces the setpoint (step 4230). To allow time for the meterto settle after the setpoint change, the controller then implements apause of the procedure by setting the pause cycle count equal to anappropriate value (e.g., 100) (step 4235).

If the procedure has not been paused, the controller determines whetherthe filtered drive current is less than a threshold level (step 4240)and the setpoint is less than a maximum permitted setpoint (step 4245).In one implementation, the threshold level equals seventy percent of themaximum available current. If both conditions are met, the controllerdetermines a possible new setpoint (step 4250). In one implementation,the controller determines the new setpoint as eighty percent of themaximum available current multiplied by the ratio of filtered_SV tofiltered_DC. To avoid small changes in the setpoint (i.e., chattering),the controller then determines whether the possible new setpoint exceedsthe current setpoint by a sufficient amount (step 4255). In oneimplementation, the possible new setpoint must exceed the currentsetpoint by 0.02 V and by ten percent.

If the possible new setpoint is sufficiently large, the controllerdetermines if it is greater than the maximum permitted setpoint (step4260). If so, the controller sets the setpoint equal to the maximumpermitted setpoint (step 4265). Otherwise, the controller sets thesetpoint equal to the possible new setpoint (step 4270). The controllerthen implements a pause of the procedure by setting the pause cyclecount equal to an appropriate value (step 4235).

FIGS. 43A-43C illustrate operation of the setpoint adjustment procedure.As shown in FIG. 43C, the system starts with a setpoint of 0.3 V. Atabout eight seconds of operation, aeration results in a drop in theapparent density of the material in the conduit (FIG. 43A). Increaseddamping accompanying the aeration results in an increase in the drivecurrent (FIG. 43B) and increased noise in the sensor voltage (FIG. 43C).No changes are made at this time, since the meter is able to maintainthe desired setpoint.

At about fifteen seconds of operation, aeration increases and theapparent density decreases further (FIG. 43A). At this level ofaeration, the driver current (FIG. 43B) reaches a maximum value that isinsufficient to maintain the 0.3 V setpoint. Accordingly, the sensorvoltage drops to 0.26 V (FIG. 43C), the voltage level that the maximumdriver current is able to maintain. In response to this condition, thecontroller adjusts the setpoint (at about 28 seconds of operation) to alevel (0.23 V) that does not require generation of the maximum drivercurrent.

At about 38 seconds of operation, the level of aeration decreases andthe apparent density increases (FIG. 43A). This results in a decrease inthe drive current (FIG. 43B). At 40 seconds of operation, the controllerresponds to this condition by increasing the setpoint (FIG. 43C). Thelevel of aeration decreases and the apparent density increases again atabout 48 seconds of operation, and the controller responds by increasingthe setpoint to 0.3 V.

K. Performance Results

The digital flowmeter has shown remarkable performance improvementsrelative to traditional analog flowmeters. In one experiment, theability of the two types of meters to accurately measure a batch ofmaterial was examined. In each case, the batch was fed through theappropriate flowmeter and into a tank, where the batch was weighed. For1200 and 2400 pound batches, the analog meter provided an average offsetof 500 pounds, with a repeatability of 200 pounds. By contrast, thedigital meter provided an average offset of 40 pounds, with arepeatability of two pounds, which clearly is a substantial improvement.

In each case, the conduit and surrounding pipework were empty at thestart of the batch. This is important in many batching applicationswhere it is not practical to start the batch with the conduit full. Thebatches were finished with the flowtube full. Some positive offset isexpected because the flowmeter is measuring the material needed to fillthe pipe before the weighing tank starts to be filled. Delays instarting up, or offsets caused by aerated flow or low amplitudes ofoscillation, are likely to introduce negative offsets. For real batchingapplications, the most important issue is the repeatability of themeasurement.

The results show that with the analog flowmeter there are large negativeoffsets and repeatability of only 200 pounds. This is attributable tothe length of time taken to startup after the onset of flow (duringwhich no flow is metered), and measurement errors until full amplitudeof oscillation is achieved. By comparison, the digital flowmeterachieves a positive offset, which is attributable to filling up of theempty pipe, and a repeatability of two pounds.

Another experiment compared the general measurement accuracy of the twotypes of meters. FIG. 44 illustrates the accuracy and correspondinguncertainty of the measurements produced by the two types of meters atdifferent percentages of the meters' maximum recommended flow rate. Athigh flow rates (i.e., at rates of 25% or more of the maximum rate), theanalog meter produces measurements that correspond to actual values towithin 0.15% or less, compared to 0.005% or less for the digital meter.At lower rates, the offset of the analog meter is on the order of 1.5%,compared to 0.25% for the digital meter.

L. Self-Validating Meter

The digital flowmeter may used in a control system that includesself-validating sensors. To this end, the digital flowmeter may beimplemented as a self-validating meter. Self-validating meters and othersensors are described in U.S. Pat. No. 5,570,300, titled“SELF-VALIDATING SENSORS”, which is incorporated by reference.

In general, a self-validating meter provides, based on all informationavailable to the meter, a best estimate of the value of a parameter(e.g., mass flow) being monitored. Because the best estimate is based,in part, on nonmeasurement data, the best estimate does not alwaysconform to the value indicated by the current, possibly faulty,measurement data. A self-validating meter also provides informationabout the uncertainty and reliability of the best estimate, as well asinformation about the operational status of the sensor. Uncertaintyinformation is derived from known uncertainty analyses and is providedeven in the absence of faults.

In general, a self-validating meter provides four basic parameters: avalidated measurement value (VMV), a validated uncertainty (VU), anindication (MV status) of the status under which the measurement wasgenerated, and a device status. The VMV is the meter's best estimate ofthe value of a measured parameter. The VU and the MV status areassociated with the VMV. The meter produces a separate VMV, VU and MVstatus for each measurement. The device status indicates the operationalstatus of the meter.

The meter also may provide other information. For example, upon arequest from a control system, the meter may provide detailed diagnosticinformation about the status of the meter. Also, when a measurement hasexceeded, or is about to exceed, a predetermined limit, the meter cansend an alarm signal to the control system. Different alarm levels canbe used to indicate the severity with which the measurement has deviatedfrom the predetermined value.

VMV and VU are numeric values. For example, VMV could be a temperaturemeasurement valued at 200 degrees and VU, the uncertainty of VMV, couldbe 9 degrees. In this case, there is a high probability (typically 95%)that the actual temperature being measured falls within an envelopearound VMV and designated by VU (i.e., from 191 degrees to 209 degrees).

The controller generates VMV based on underlying data from the sensors.First, the controller derives a raw measurement value (RMV) that isbased on the signals from the sensors. In general, when the controllerdetects no abnormalities, the controller has nominal confidence in theRMV and sets the VMV equal to the RMV. When the controller detects anabnormality in the sensor, the controller does not set the VMV equal tothe RMV. Instead, the controller sets the VMV equal to a value that thecontroller considers to be a better estimate than the RMV of the actualparameter.

The controller generates the VU based on a raw uncertainty signal (RU)that is the result of a dynamic uncertainty analysis of the RMV. Thecontroller performs this uncertainty analysis during each samplingperiod. Uncertainty analysis, originally described in “DescribingUncertainties in Single Sample Experiments,” S. J. Kline & F. A.McClintock, Mech. Eng., 75, 3-8 (1953), has been widely applied and hasachieved the status of an international standard for calibration.Essentially, an uncertainty analysis provides an indication of the“quality” of a measurement. Every measurement has an associated error,which, of course, is unknown. However, a reasonable limit on that errorcan often be expressed by a single uncertainty number (ANSI/ASME PTC19.1-1985 Part 1, Measurement Uncertainty Instruments and Apparatus).

As described by Kline & McClintock, for any observed measurement M, theuncertainty in M, w_(M), can be defined as follows:M_(true)ε[M−w_(M),M+w_(M)]where M is true (M_(true)) with a certain level of confidence (typically95%). This uncertainty is readily expressed in a relative form as aproportion of the measurement (i.e. w_(M)/M).

In general, the VU has a non-zero value even under ideal conditions(i.e., a faultless sensor operating in a controlled, laboratoryenvironment). This is because the measurement produced by a sensor isnever completely certain and there is always some potential for error.As with the VMV, when the controller detects no abnormalities, thecontroller sets the VU equal to the RU. When the controller detects afault that only partially affects the reliability of the RMV, thecontroller typically performs a new uncertainty analysis that accountsfor effects of the fault and sets the VU equal to the results of thisanalysis. The controller sets the VU to a value based on pastperformance when the controller determines that the RMV bears norelation to the actual measured value.

To ensure that the control system uses the VMV and the VU properly, theMV status provides information about how they were calculated. Thecontroller produces the VMV and the VU under all conditions—even whenthe sensors are inoperative. The control system needs to know whetherVMV and VU are based on “live” or historical data. For example, if thecontrol system were using VMV and VU in feedback control and the sensorswere inoperative, the control system would need to know that VMV and VUwere based on past performance.

The MV status is based on the expected persistence of any abnormalcondition and on the confidence of the controller in the RMV. The fourprimary states for MV status are generated according to Table 1.

TABLE 1 Expected Confidence Persistence in RMV MV Status not applicablenominal CLEAR not applicable reduced BLURRED short zero DAZZLED longzero BLIND

A CLEAR MV status occurs when RMV is within a normal range for givenprocess conditions. A DAZZLED MV status indicates that RMV is quiteabnormal, but the abnormality is expected to be of short duration.Typically, the controller sets the MV status to DAZZLED when there is asudden change in the signal from one of the sensors and the controlleris unable to clearly establish whether this change is due to an as yetundiagnosed sensor fault or to an abrupt change in the variable beingmeasured. A BLURRED MV status indicates that the RMV is abnormal butreasonably related to the parameter being measured. For example, thecontroller may set the MV status to BLURRED when the RMV is a noisysignal. A BLIND MV status indicates that the RMV is completelyunreliable and that the fault is expected to persist.

Two additional states for the MV status are UNVALIDATED and SECURE. TheMV status is UNVALIDATED when the controller is not performingvalidation of VMV. MV status is SECURE when VMV is generated fromredundant measurements in which the controller has nominal confidence.

The device status is a generic, discrete value summarizing the health ofthe meter. It is used primarily by fault detection and maintenanceroutines of the control system. Typically, the device status 32 is inone of six states, each of which indicates a different operationalstatus for the meter. These states are: GOOD, TESTING, SUSPECT,IMPAIRED, BAD, or CRITICAL. A GOOD device status means that the meter isin nominal condition. A TESTING device status means that the meter isperforming a self check, and that this self check may be responsible forany temporary reduction in measurement quality. A SUSPECT device statusmeans that the meter has produced an abnormal response, but thecontroller has no detailed fault diagnosis. An IMPAIRED device statusmeans that the meter is suffering from a diagnosed fault that has aminor impact on performance. A BAD device status means that the meterhas seriously malfunctioned and maintenance is required. Finally, aCRITICAL device status means that the meter has malfunctioned to theextent that the meter may cause (or have caused) a hazard such as aleak, fire, or explosion.

FIG. 45 illustrates a procedure 4500 by which the controller of aself-validating meter processes digitized sensor signals to generatedrive signals and a validated mass flow measurement with an accompanyinguncertainty and measurement status. Initially, the controller collectsdata from the sensors (step 4505). Using this data, the controllerdetermines the frequency of the sensor signals (step 4510). If thefrequency falls within an expected range (step 4515), the controllereliminates zero offset from the sensor signals (step 4520), anddetermines the amplitude (step 4525) and phase (step 4530) of the sensorsignals. The controller uses these calculated values to generate thedrive signal (step 4535) and to generate a raw mass flow measurement andother measurements (step 4540).

If the frequency does not fall within an expected range (step 4515),then the controller implements a stall procedure (step 4545) todetermine whether the conduit has stalled and to respond accordingly. Inthe stall procedure, the controller maximizes the driver gain andperforms a broader search for zero crossings to determine whether theconduit is oscillating at all.

If the conduit is not oscillating correctly (i.e., if it is notoscillating, or if it is oscillating at an unacceptably high frequency(e.g., at a high harmonic of the resonant frequency)) (step 4550), thecontroller attempts to restart normal oscillation (step 4555) of theconduit by, for example, injecting a square wave at the drivers. Afterattempting to restart oscillation, the controller sets the MV status toDAZZLED (step 4560) and generates null raw measurement values (step4565). If the conduit is oscillating correctly (step 4550), thecontroller eliminates zero offset (step 4520) and proceeds as discussedabove.

After generating raw measurement values (steps 4540 or 4565), thecontroller performs diagnostics (step 4570) to determine whether themeter is operating correctly (step 4575). (Note that the controller doesnot necessarily perform these diagnostics during every cycle.)

Next, the controller performs an uncertainty analysis (step 4580) togenerate a raw uncertainty value. Using the raw measurements, theresults of the diagnostics, and other information, the controllergenerates the VMV, the VU, the MV status, and the device status (step4585). Thereafter, the controller collects a new set of data and repeatsthe procedure. The steps of the procedure 4500 may be performed seriallyor in parallel, and may be performed in varying order.

In another example, when aeration is detected, the mass flow correctionsare applied as described above, the MV status becomes blurred, and theuncertainty is increased to reflect the probable error of the correctiontechnique. For example, for a flowtube operating at 50% flowrate, undernormal operating conditions, the uncertainty might be of the order of0.1-0.2% of flowrate. If aeration occurs and is corrected for using thetechniques described above, the uncertainty might be increased toperhaps 2% of reading. Uncertainty values should decrease asunderstanding of the effects of aeration improves and the ability tocompensate for aeration gets better. In batch situations, where flowrate uncertainty is variable (e.g. high at start/end if batching from/toempty, or during temporary incidents of aeration or cavitation), theuncertainty of the batch total will reflect the weighted significance ofthe periods of high uncertainty against the rest of the batch withnominal low uncertainty. This is a highly useful quality metric infiscal and other metering applications.

M. Two Wire Flowmeter

As shown in FIG. 46, the techniques described above may be used toimplement a “two-wire” Coriolis flowmeter 4600 that performsbidirectional communications on a pair of wires 4605. A power circuit4610 receives power for operating a digital controller 4615 and forpowering the driver(s) 4620 to vibrate the conduit 4625. For example,the power circuit may include a constant output circuit 4630 thatprovides operating power to the controller and a drive capacitor 4635that is charged using excess power. The power circuit may receive powerfrom the wires 4605 or from a second pair of wires. The digitalcontroller receives signals from one or more sensors 4640.

When the drive capacitor is suitably charged, the controller 4615discharges the capacitor 4635 to drive the conduit 4625. For example,the controller may drive the conduit once during every 10 cycles. Thecontroller 4615 receives and analyzes signals from the sensors 4640 toproduce a mass flow measurement that the controller then transmits onthe wires 4605.

N. Batching from Empty

The digital mass flowmeter 100 provides improved performance in dealingwith a challenging application condition that is referred to as batchingfrom empty. There are many processes, particularly in the food andpetrochemical industries, where the high accuracy and direct mass-flowmeasurement provided by Coriolis technology is beneficial in themetering of batches of material. In many cases, however, ensuring thatthe flowmeter remains full of fluid from the start to the end of thebatch is not practical, and is highly inefficient. For example, infilling or emptying a tanker, air entrainment is difficult to avoid. Infood processing, hygiene regulations may require pipes to be cleaned outbetween batches.

In conventional Coriolis meters, batching from empty may result in largeerrors. For example, hydraulic shock and a high gain requirement may becaused by the onset of flow in an empty flowtube, leading to largemeasurement errors and stalling.

The digital mass flowmeter 100 is robust to the conditions experiencedwhen batching from empty. More specifically, the amplitude controllerhas a rapid response; the high gain range prevents flowtube stalling;measurement data can be calculated down to 0.1% of the normal amplitudeof oscillation; and there is compensation for the rate of change ofamplitude.

These characteristics are illustrated in FIGS. 47A-47C, which show theresponse of the digital mass flowmeter 100 driving a wet and empty 25 mmflowtube during the first seconds of the onset of full flow. As shown inFIG. 47A, the drive gain required to drive the wet and empty tube priorto the onset of flow (at about 4.0 seconds) has a value of approximately0.1, which is higher than the value of approximately 0.034 needed for afull flowtube. The onset of flow is characterized by a substantialincrease in gain and a corresponding drop in amplitude of oscillation.With reference to FIG. 47B, at about 1.0 second after initiation, theselection of a reduced setpoint assists in the stabilization ofamplitude while the full flow regime is established. After about 2.75seconds, the last of the entrained air is purged, the conventionalsetpoint is restored, and the drive gain assumes the nominal value of0.034. The raw and corrected phase difference behavior is shown in FIG.47C.

As shown in FIGS. 47A-47C, phase data is given continuously throughoutthe transition. In similar circumstances, the analog control systemstalls, and is unable to provide measurement data until the requireddrive gain returns to a near-nominal value and the lengthy start-upprocedure is completed. As also shown, the correction for the rate ofchange of amplitude is clearly beneficial, particularly after 1.0seconds. Oscillations in amplitude result in substantial swings in theFourier-based and time-based calculations of phase, but these aresubstantially reduced in the corrected phase measurement. Even in themost difficult part of the transition, from 0.4-1.0 seconds, thecorrection provides some noise reduction.

Of course there are still erroneous data in this interval. For example,flow generating a phase difference in excess of about 5 degrees isphysically not possible. However, from the perspective of a selfvalidating sensor, such as is discussed above, this phase measurementstill constitutes raw data that may be corrected. In someimplementations, a higher level validation process may identify the datafrom 0.4-1.0 seconds as unrepresentative of the true process value(based on the gain, amplitude and other internal parameters), and maygenerate a DAZZLED mass-flow to suppress extreme measurement values.

Referring to FIG. 48A, the response of the digital mass flowmeter 100 tothe onset of flow results in improved accuracy and repeatability. Anexemplary flow rig 4800 is shown in FIG. 48B. In producing the resultsshown in FIG. 48A, as in producing the results shown in FIG. 44, fluidwas pumped through a magnetic flowmeter 4810 and a Coriolis flowmeter4820 into a weighing tank 4830, with the Coriolis flowmeter being eithera digital flowmeter or a traditional analog flowmeter. Valves 4840 and4860 were used to ensure that the magnetic flowmeter 4810 was alwaysfull, while the flowtube of the Coriolis flowmeter 4820 began each batchempty. At the start of the batch, the totalizers in the magneticflowmeter 4810 and in the Coriolis flowmeter 4820 were reset and flowcommenced. At the end of the batch, the shutoff valve 4850 was closedand the totals were frozen (hence the Coriolis flowmeter 4820 was fullat the end of the batch). Three totals were recorded, with one each fromthe magnetic flowmeter 4810 and the Coriolis flowmeter 4820, and onefrom the weigh scale associated with the weighing tank 4830. Thesetotals are not expected to agree, as there is a finite time delay beforethe Coriolis flowmeter 4820 and then finally the weighing tank 4830observes fluid flow. Thus, it would be expected that the magneticflowmeter 4810 would record the highest total flow, the Coriolisflowmeter 4820 would record the second highest total, and the weighingtank 4830 would record the lowest total.

FIG. 48A shows the results obtained from a series of trial runs usingthe flow rig 4800 of FIG. 48B, with each trial run transporting about550 kg of material through the flow rig. The monitored value shown isthe offset observed between the weigh scale and either the magneticflowmeter 4810 or the Coriolis flowmeter 4820. As explained above,positive offsets are expected from both instruments. The magneticflowmeter 4810 (always full) delivers a consistently positive offset,with a repeatability (defined here as the maximum difference in reportedvalue for identical experiments) of 4.0 kg. The analog control systemassociated with the magnetic flowmeter 4810 generates large negativeoffsets, with a mean of −164.2 kg and a repeatability of 87.7 kg. Thispoor performance is attributable to the analog control system'sinability to deal with the onset of flow and the varying time taken torestart the flowtube. By contrast, the digital Coriolis mass flowmeter4820 shows a positive offset averaging 25.6 kg and a repeatability of0.6 kg.

It would be difficult to assess the true mass-flow through the flowtube,given its initially empty state. The reported total mass falls betweenthat of the magnetic flowmeter 4810 and the weigh scale, as expected. Inan industrial application, the issue of repeatability is often ofgreater importance, as batch recipes are often adjusted to accommodateoffsets. Of course, the repeatability of the filling process is a lowerbound on the repeatability of the Coriolis flowmeter total. Similarrepeatability could be achieved in an arbitrary industrial batchprocess. Moreover, as shown, the digital mass flowmeter 100 provides asubstantial performance improvement over its analog equivalent (magneticflowmeter 4810) under the same conditions. Again, the conclusion drawnis that the digital mass flowmeter 100 in these conditions is not asignificant source of measurement error.

O. Two-Phase Flow

As discussed above with reference to FIG. 40A, two-phase flow, which mayresult from aeration, is another flow condition which presentsdifficulties for analog control systems and analog mass flowmeters.Two-phase flow may be sporadic or continuous and results when thematerial in the flowmeter includes a gas component and a fluid componenttraveling through the flowtube. The underlying mechanisms are verysimilar to the case of batching from empty, in that the dynamics oftwo-phase gas-liquid flow cause high damping. To maintain oscillation, ahigh drive gain is required. However, the maximum drive gain of theanalog control system typically is reached at low levels of gas fractionin the two-phase material, and, as a result, the flowtube stalls.

The digital mass flowmeter 100 is able to maintain oscillation in thepresence of two-phase flow. In summary, laboratory experiments conductedthus far have been unable to stall a tube of any size with any level ofgas phase when controlled by the digital controller 105. By contrast, atypical analog control system stalls with about 2% gas phase.

Maintaining oscillation is only the first step in obtaining asatisfactory measurement performance from the flowmeter. As brieflydiscussed above, a simple model, referred to as the “bubble” model, hasbeen developed as one technique to predict the mass-flow error.

In the “bubble” or “effective mass” model, a sphere or bubble of lowdensity gas is surrounded by fluid of higher density. If both aresubject to acceleration (for example in a vibrating tube), then thebubble moves within the fluid, causing a drop in the observed inertia ofthe whole system. Defining the void fraction α as the proportion of gasby volume, then the effective mass drops by a proportion R, with

$R = {\frac{2\alpha}{1 - \alpha}.}$

Applied to a Coriolis flowmeter, the model predicts that the apparentmass-flow will be less than the true mass-flow by the factor R as will,by extension, the observed density. FIG. 49 shows the observed mass-flowerrors for a series of runs at different flow rates, all using a 25 mmflowtube in horizontal alignment, and a mixture of water and air atambient temperature. The x-axis shows the apparent drop in density,rather than the void fraction. It is possible in the laboratory tocalculate the void fraction, for example by measuring the gas pressureand flow rate prior to mixing with the fluid, together with the pressureof the two-phase mixture. However, in a plant, only the observed drop indensity is available, and the true void fraction is not available. Notethat with the analog flowmeter, air/water mixtures with a density dropof over 5% cause flowtube stalling so that no data can be collected.

The dashed line 4910 shows the relationship between mass-flow error anddensity drop as predicted by the bubble model. The experimental datafollow a similar set of curves, although the model almost alwayspredicts a more negative mass-flow error. As discussed above withrespect to FIG. 40A, it is possible to develop empirical corrections tothe mass-flow rate based upon the apparent density as well as severalother internally observed variables, such as the drive gain and theratio of sensor voltages. It is reasonable to assume that the density ofthe pure fluid is known or can be learned. For example, in manyapplications the fluid density is relatively constant (particularly if atemperature coefficient is accommodated within the controller software).

FIG. 50 shows the corrected mass-flow measurements. The correction isbased on a least squares fit of several internal variables, as well asthe bubble model itself. The correction process has only limitedapplicability, and it is less accurate for lower flow rates (the biggesterrors are for 1.5-1.6 kg/second). In horizontal orientation, the gasand liquid phase begin to separate for lower flow rates, and much largermass-flow errors are observed. In these circumstances, the assumptionsof the bubble model are no longer valid. However, the correction isreasonable for higher flow rates. During on-line experimental trials, asimilar correction algorithm has restricted mass flow errors to withinabout 2.5% of the mass flow reading.

FIG. 51 shows how a self validating digital mass flowmeter 100 respondsto the onset of two-phase flow in its reporting of the mass-flow rate.The lower waveform 5110 shows an uncorrected mass-flow measurement undera two-phase flow condition, and the upper waveform 5120 shows acorrected mass-flow measurement and uncertainty bound under the sametwo-phase flow condition. With single phase flow (up to t=7 sec.), themass-flow measurement is CLEAR and has a small uncertainty of about 0.2%of the mass flow reading. With the onset of two-phase flow, a number ofprocesses become active. First, the two-phase flow is detected on thebasis of the behavior of internally observed parameters. Second, ameasurement correction process is applied, and the measurement statusoutput along with the corrected measurement is set to BLURRED. Third,the uncertainty of the mass flow increases with the level of voidfraction to a maximum of about 2.3% of the mass flow reading. Forcomparison, the uncorrected mass-flow measurement 5110 is shown directlybelow the corrected mass-flow measurement 5120. The user thus has theoption of continuing operation with the reduced quality of the correctedmass-flow rate, switching to an alternative measurement if available, orshutting down the process.

P. Application of Neural Networks

Another technique for improving the accuracy of the mass flowmeasurement during two-phase flow conditions is through the use of aneural network to predict the mass-flow error and to generate an errorcorrection factor for correcting any error in the mass-flow measurementresulting from two-phase flow effects. The correction factor isgenerated using internally observed parameters as inputs to the digitalsignal processor and the neural network, and has been observed to keeperrors to within 2%. The internally observed parameters may includetemperature, pressure, gain, drop in density, and apparent flow rate.

FIG. 52 shows a digital controller 5200 that can be substituted fordigital controller 105 or 505 of the digital mass flowmeters 100, 500 ofFIGS. 1 and 5. In this implementation of digital controller 5200,process sensors 5204 connected to the flowtube generate process signalsincluding one or more sensor signals, a temperature signal, and one ormore pressure signals (as described above). The analog process signalsare converted to digital signal data by A/D converters 5206 and storedin sensor and driver signal data memory buffers 5208 for use by thedigital controller 5200. The drivers 5245 connected to the flowtubegenerate a drive current signal and may communicate this signal to theA/D converters 5206. The drive current signal then is converted todigital data and stored in the sensor and driver signal data memorybuffers 5208. Alternatively, a digital drive gain signal and a digitaldrive current signal may be generated by the amplitude control module5235 and communicated to the sensor and driver signal data memorybuffers 5208 for storage and use by the digital controller 5200.

The digital process sensor and driver signal data are further analyzedand processed by a sensor and driver parameters processing module 5210that generates physical parameters including frequency, phase, current,damping and amplitude of oscillation. A raw mass-flow measurementcalculation module 5212 generates a raw mass-flow measurement signalusing the techniques discussed above with respect to the flowmeter 500.

A flow condition state machine 5215 receives as input the physicalparameters from the sensor and driver parameters processing module 5210,the raw mass-flow measurement signal, and a density measurement 5214that is calculated as described above. The flow condition state machine5215 then detects a flow condition of material traveling through thedigital mass flowmeter 100. In particular, the flow condition statemachine 5215 determines whether the material is in a single-phase flowcondition or a two-phase flow condition. The flow condition statemachine 5215 also inputs the raw mass-flow measurement signal to amass-flow measurement output block 5230.

When a single-phase flow condition is detected, the output block 5230validates the raw mass-flow measurement signal and may perform anuncertainty analysis to generate an uncertainty parameter associatedwith the validated mass-flow measurement. In particular, when the statemachine 5215 detects that a single-phase flow condition exists, nocorrection factor is applied to the raw mass-flow measurement, and theoutput block 5230 validates the mass-flow measurement. If the controller5200 does not detect errors in producing the measurement, the outputblock 5230 may assign to the measurement the conventional uncertaintyparameter associated with the fault free measurement, and may set thestatus flag associated with the measurement to CLEAR. If errors aredetected by the controller 5200 in producing the measurement, the outputblock 5230 may modify the uncertainty parameter to a greater uncertaintyvalue, and may set the status flag to another value such as BLURRED.

When the flow condition state machine 5215 detects that a two-phase flowcondition exists, a two-phase flow error correction module 5220 receivesthe raw mass-flow measurement signal. The two-phase flow errorcorrection module 5220 includes a neural network processor forpredicting a mass-flow error and for calculating an error correctionfactor. The neural network processor can be implemented in a softwareroutine, or alternatively may be implemented as a separate programmedhardware processor. Operation of the neural network processor isdescribed in greater detail below.

A neural network coefficients and training module 5225 stores apredetermined set of neural network coefficients that are used by theneural network processor. The neural network coefficients and trainingmodule 5225 also may perform an online training function using trainingdata so that an updated set of coefficients can be calculated for use bythe neural network. While the predetermined set of neural networkcoefficients are generated through extensive laboratory testing andexperiments based upon known two-phase mass-flow rates, the onlinetraining function performed by module 5225 may occur at the initialcommissioning stage of the flowmeter, or may occur each time theflowmeter is initialized.

The error correction factor generated by the error correction module5220 is input to the mass-flow measurement output block 5230. Using theraw mass-flow measurement and the error correction factor (if receivedfrom the error correction module 5220 indicating two-phase flow), themass-flow measurement output block 5230 applies the error correctionfactor to the raw mass-flow measurement to generate a correctedmass-flow measurement. The measurement output block 5230 then validatesthe corrected mass-flow measurement, and may perform an uncertaintyanalysis to generate an uncertainty parameter associated with thevalidated mass-flow measurement. The measurement output block 5230 thusgenerates a validated mass-flow measurement signal that may include anuncertainty and status associated with each validated mass-flowmeasurement, and a device status.

The sensor parameters processing module 5210 also inputs a dampingparameter and an amplitude of oscillation parameter (previouslydescribed) to an amplitude control module 5235. The amplitude controlmodule 5235 further processes the damping parameter and the amplitude ofoscillation parameter and generates digital drive signals. The digitaldrive signals are converted to analog drive signals by D/A converters5240 for operating the drivers 5245 connected to the flowtube of thedigital flowmeter. In an alternate implementation, the amplitude controlmodule 5235 may process the damping parameter and the amplitude ofoscillation parameter and generate analog drive signals for operatingthe drivers 5245 directly.

FIG. 53 shows a procedure 5250 performed by the digital controller 5200.After processing begins (step 5251), measurement signals generated bythe process sensors 5204 and drivers 5245 are quantified through ananalog to digital conversion process (as described above), and thememory buffers 5208 are filled with the digital sensor and driver data(step 5252). For every new processing cycle, the sensor and driverparameters processing module 5210 retrieves the sensor and driver datafrom the buffers 5208 and calculates sensor and driver variables fromthe sensor data (step 5254). In particular, the sensor and driverparameters processing module 5210 calculates sensor voltages, sensorfrequencies, drive current, and drive gain.

The sensor and driver parameters processing module 5210 then executes adiagnose_flow_condition processing routine (step 5256) to calculatestatistical values including the mean, standard deviation, and slope foreach of the sensor and driver variables. Based upon the statisticscalculated for each of the sensor and driver variables, the flowcondition state machine 5215 detects transitions between one of threevalid flow-condition states: FLOW_CONDITION_SHOCK,FLOW_CONDITION_HOMOGENEOUS, AND FLOW_CONDITION_MIXED.

If the state FLOW_CONDITION_SHOCK is detected (step 5258), the mass-flowmeasurement analysis process is not performed due to irregular sensorinputs. On exit from this condition, the processing routine starts a newcycle (step 5251). The processing routine then searches for a newsinusoidal signal to track within the sensor signal data and resumesprocessing. As part of this tracking process, the processing routinemust find the beginning and end of the sine wave using the zero crossingtechnique described above. If the state FLOW_CONDITION_SHOCK is notdetected, the processing routine calculates the raw mass-flowmeasurement of the material flowing through the flowmeter 100 (step5260).

If two-phase flow is not detected (i.e., the stateFLOW_CONDITION_HOMOGENOUS is detected) (step 5270), the material flowingthrough the flowmeter 100 is assumed to be a single-phase material. Ifso, the validated mass-flow rate is generated from the raw mass-flowmeasurement (step 5272) by the mass-flow measurement output block 5230.At this point, the validated mass-flow rate along with its uncertaintyparameter and status flag can be transmitted to another processcontroller. Processing then begins a new cycle (step 5251).

If two-phase flow is detected (i.e., the state FLOW_CONDITION_MIXED isdetected) (step 5270), the material flowing through the flowmeter 100 isassumed to be a two-phase material. In this case, the two-phase flowerror correction module 5220 predicts the mass-flow error and generatesan error correction factor using the neural network processor (step5274). The corrected mass-flow rate is generated by the mass-flowmeasurement output block 5230 using the error correction factor (step5276). A validated mass-flow rate then may be generated from thecorrected mass-flow rate. At this point, the validated mass-flow ratealong with its uncertainty parameter and status flag can be transmittedto another process controller. Processing then begins a new cycle (step5251).

Referring again to FIG. 52, the neural network processor forming part ofthe two-phase flow error correction module 5220 is a feed-forward neuralnetwork that provides a non-parametric framework for representing anon-linear functional mapping between an input and an output space. Theneural network is applied to predict mass flow errors during two-phaseflow conditions in the digital mass flowmeter. Once the error ispredicted by the neural network, an error correction factor is appliedto the two-phase mass flow measurement to correct the errors. Thus, thesystem allows the errors to be predicted on-line by way of the neuralnetwork using only internally observable parameters derived from thesensor signal, sensor variables, and sensor statistics.

Of the various neural network models available, the multi-layerperceptron (MLP) and the radial basis function (RBF) networks have beenused for implementations of the digital flowmeter. The MLP with onehidden layer (each unit having a sigmoidal activation function) canapproximate arbitrarily well any continuous mapping. Therefore, thistype of neural network is suitable to model the non-linear relationshipbetween the mass flow error of the flowmeter under two-phase flow andsome of the flowmeter's internal parameters.

The network weights necessary for accomplishing the desired mapping aredetermined during a training or optimization process. During supervisedtraining, the neural network is repeatedly presented with the trainingset (a collection of input examples x_(i) and their correspondingdesired outputs d_(i)), and the weights are updated such that an errorfunction is minimized. For the interpolation problem associated with thepresent technique, a suitable error function is the sum-of-squareserror, which for an MLP with one output may be represented as:

$I = {{\sum\limits_{i = 1}^{P}{e_{i}(t)}^{2}} = {\sum\limits_{i = 1}^{P}\left( {d_{i} - y_{i}} \right)^{2}}}$where d_(i) is the target corresponding to input x_(i); y_(i) is theactual neural network output to x_(i); and P is the number of examplesin the training set.

An alternative neural network architecture that has been used is the RBFnetwork. The RBF methods have their origins in techniques for performingexact interpolations of a set of data points in a multi-dimensionalspace. A RBF network generally has a simple architecture of two layersof weights, in which the first layer contains the parameters of thebasis functions, and the second layer forms linear combinations of theactivation of the basis functions to generate the outputs. This isachieved by representing the output of the network as a linearsuperposition of basis functions, one for each data point in thetraining set. In this form, training is faster than for a MLP network.

The internal sensor parameters of interest include observed density,damping, apparent flow rate, and temperature. Each of these parametersis discussed below.

1. Observed Density

The most widely used metric of two-phase flow is the void (or gas)fraction defined as the proportion of gas by volume. The equation

$R = \frac{2\alpha}{1 - \alpha}$models the mass flow error given the void fraction. For a Coriolis massflowmeter, the reported process fluid density provides an indirectmeasure of void fraction assuming the “true” liquid density in known.This reported process density is subject to errors similar to those inthe mass-flow measurement in the presence of two-phase flow. Theseerrors are highly repeatable and a drop in density is a suitablemonotonic but non-linear indicator of void fraction, that can bemonitored on-line within the flowmeter. It should be noted that outsideof a laboratory environment, the true void fraction cannot beindependently assessed, but rather, must be modeled as described above.

Knowledge of the “true” single-phase liquid density can be obtainedon-line or can be configured by the user (possibly including atemperature coefficient). Both approaches have been implemented andappear satisfactory.

For the purposes of these descriptions, the drop in density will be usedas the x-axis parameter in graphs showing two-phase flow behavior. Itshould be noted that in the 3D plots of FIGS. 54 and 56-57, whichcapture the results from 134 on-line experiments, a full range ofdensity drop points is not possible at high flow rates due to airpressure limitations in the flow system rig. Also, the effects oftemperature, though not shown in the graphs, have been determinedexperimentally.

2. Damping

Most Coriolis flowmeters use positive feedback to maintain flowtubeoscillation. The sensor signals provide the frequency and phase of theflowtube oscillation, which are multiplied by a drive gain, K₀ toprovide the currents supplied to the drivers 5245:

$K_{0} = {\frac{{drive}\mspace{14mu}{signal}\mspace{14mu}{out}\mspace{11mu}({Amps})}{{sensor}\mspace{14mu}{signal}\mspace{14mu}{in}\mspace{14mu}({Volts})} = {\frac{I_{D}}{V_{A}}.}}$

Normally, the drive gain is modified to ensure a constant amplitude ofoscillation, and is roughly proportional to the damping factor of theflowtube.

One of the most characteristic features of two-phase flow is a rapidrise in damping. For example, a normally operating 25 mm flowtube hasV_(A)=0.3V, I_(D)=10 mA, and hence K₀=0.033. With two-phase flow, valuesmight be as extreme as V_(A)=0.03V, I_(D)=100 mA, and K₀=3.3, ahundred-fold increase. FIG. 54 shows how damping varies with two-phaseflow.

3. Apparent Flow Rate and Temperature

As FIG. 49 shows, the mass flow error varies with the true flow rate.Temperature variation also has been observed. However, the truemass-flow rate is not available within the transmitter (or digitalcontroller) itself when the flowmeter is subject to two-phase flow.However, observed (faulty) flow rate, as well as the temperature, arecandidates as input parameters to the neural network processor.

Q. Network Training and On-Line Correction of Mass Flow Errors

Implementing the neural network analysis for the mass flow measurementerror prediction includes training the neural network processor torecognize the mass flow error pattern in training experimental data,testing the performance of the neural network processor on a new set ofexperimental data, and on-line implementation of the neural networkprocessor for measurement error prediction and correction.

The prediction quality of the neural network processor depends on thewealth of the training data. To collect the neural network data, aseries of two-phase air/water experiments were performed using anexperimental flow rig 5500 shown in FIG. 55. The flow loop includes amaster meter 5510, the self validating SEVA® Coriolis flowmeter 100, anda diverter 5520 to transfer material from the flowtube to a weigh scale5530. The Coriolis flowmeter 100 has a totalization function which canbe triggered by external signals. The flow rig control is arranged sothat both the flow diverter 5520 (supplying the weigh scale) andCoriolis totalization are triggered by the master meter 5510 at thebeginning of the experiment, and again after the master meter 5510 hasobserved 100 kg of flow. The weigh scale total is used as the referenceto calculate mass flow error by comparison with the totalized flow fromthe digital flowmeter 100, with the master meter 5510 acting as anadditional check. The uncertainty of the experimental rig is estimatedat about 0.1% on typical batch sizes of 100 kg. For single-phaseexperiments, the digital flowmeter 100 delivers mass flow totals within0.2% of the weigh scale total. For two-phase flow experiments, air isinjected into the flow after the master meter 5510 and before theCoriolis flowmeter 100. At low flow rates, density drops of up to 30%are achieved. At higher flow rates, at least 15% density drops areachieved.

At the end of each batch, the Coriolis flowmeter 100 reports the batchaverage of each of the following parameters: temperature, damping,density, flow rate, and the total (uncorrected) flow. These parametersare thus available for use as the input data of the neural networkprocessor.

The output or the target of the neural network is the mass-flow error inpercentage:

${{mass\_ error}\mspace{14mu}\%} = {\frac{{coriolis} - {weighscale}}{weighscale} \times 100}$

FIG. 56 shows how the mass-flow error varies with flow rate and densitydrop. Although the general trend follows the bubble model, there areadditional features of interest. For example, for high flow rates andlow density drops, the mass-flow error becomes slightly positive (by asmuch as 1%), while the bubble model only predicts a negative error. Asis apparent from FIG. 56, in this region of the experimental space, andfor this flowtube design, some other physical process is taking place toovercome the missing mass effects of two-phase flow.

The best results were obtained using only four input parameters to theneural network: temperature, damping, density drop, and apparent flowrate. Less satisfactory perhaps is the result that the best fit wasachieved using the neural network on its own, rather than as acorrection to the bubble model or to a simplified curve fit.

As part of the implementation, a MLP neural network was used for on-lineimplementation. Comparisons between RBF and MLP networks with the samedata sets and inputs have shown broadly similar performance on the testset. It is thus reasonable to assume that the input set delivering thebest RBF design also will deliver a good (if not the best) MLP design.The MLP neural nets were trained using a scaled conjugate gradientalgorithm. The facilities of Neural Network Toolbox of the MATLAB®software package were used for neural network training. After furtherdesign options were explored, the best performance came from an 4-9-1MLP having as inputs the temperature, damping, drop in density, and flowrate, along with the mass flow error as output.

Against a validation set, the best neural network provided mass flowrate predictions to within 2% of the true value. Routines for thedetection and correction for two-phase flow have been coded andincorporated into the digital Coriolis transmitter. FIG. 57 shows theresidual mass-flow error when corrected on-line over 134 newexperiments. All errors are with 2%, and most are considerably less. Therandom scatter is due primarily to residual error in the neural networkcorrection algorithm (as stated earlier, the uncertainty of the flow rigis 0.1%). Any obvious trend in the data would imply scope for furthercorrection. These errors are of course for the average corrected massflow rate (i.e. over a batch).

FIG. 58 shows how the on-line detection and correction for two-phaseflow is reflected in the self-validating interface generated for themass flow measurement. In the graph, the lower, continuous line 5810 isthe raw mass flow rate. The upper line 5820 is a measurement surroundedby the uncertainty band, and represents the corrected or validatedmass-flow rate. The dashed line 5830 is the mass flow rate from themaster meter, which is positioned prior to the air injection point (FIG.55).

With single-phase flow (up to t=5 sec.), the mass flow measurement has ameasurement value status of CLEAR and a small uncertainty of about 0.2%of reading. Once two-phase flow is detected, the neural networkcorrection is applied every interleaved cycle (i.e. at 180 Hz), based onthe values of the internal parameters averaged (using a moving window)over the last second. During two-phase flow, the measurement valuestatus is set to BLURRED, and the uncertainty increases to reflect thereduced accuracy of the corrected measurement. The uncorrectedmeasurement (lower dark line) shows a large offset error of about 30%.

The master meter reading agrees with a first approximation with thecorrected mass flow measurement. The apparent delay in its response tothe incidence of two-phase flow is attributable to communication delaysin the rig control system, and its squarewave-like response is due tothe control system update rate of only once per second. Both the raw andcorrected measurements from the digital transmitter show a higher degreeof variation than with single phase flow. The master meter reading givesa useful measure of the water phase entering the two-phase zone, andthere is a clear similarity between the master meter reading and the‘average’ corrected reading. However, plug flow and air compressibilitywithin the complex 3-D geometry of the flowtube may result not only inflow rate variations, but with the instantaneous mass-flow into thesystem being different from the mass-flow out of the system.

Using the self-validating sensor processing approach, the measurement isnot simply labeled good or bad by the sensor. Instead, if a faultoccurs, a correction is applied as far as possible and the quality ofthe resulting measurement is indicated through the BLURRED status andincreased uncertainty. The user thus assesses application-specificrequirements and options in order to decide whether to continueoperation with the reduced quality of the corrected mass-flow rate, toswitch to an alternative measurement if available, or to shut down theprocess. If two-phase flow is present only during part of a batch run(e.g. at the beginning or end), then there will be a proportionateweighting given to the uncertainty of the total mass of the batch.

The above description provides an overview of the digital Coriolis massflowmeter, describing its background, implementation, examples of itsoperation, and a comparison to prior analog controllers andtransmitters. A number of improvements over analog controllerperformance have been achieved, including: high precision control offlowtube operation, even with operation at very low amplitudes; themaintenance of flowtube operation even in highly damped conditions; highprecision and high speed measurement; compensation for dynamic changesin amplitude; compensation for two-phase flow; and batching to/fromempty. This combination of benefits suggests that the digital massflowmeter represents a significant step forward, not simply a gradualevolution from analog technology. The ability to deal with two-phaseflow and external vibration means that the digital mass flowmeter 100gives improved performance in conventional Coriolis applications whileexpanding the range of applications to which the flow technology can beapplied. The digital platform also is a useful and flexible vehicle forcarrying out research into Coriolis metering in that it offers highprecision, computing power, and data rates.

R. Source Code Listing

The following source code, which is hereby incorporated into thisapplication, is used to implement the mass-flow rate processing routinein accordance with one implementation of the flowmeter. It will beappreciated that it is possible to implement the mass-flow rateprocessing routine using different computer code without departing fromthe scope of the invention. This listing is provided merely toillustrate the best mode currently known to the inventors to practicethe invention. Thus, neither the foregoing description nor the followingsource code listing is intended to limit the invention which is definedin the appended claims.

Source code listing void calculate_massflow(meas_data_type *p,meas_data_type *op, int validating) { double Tz, z1, z2, z3, z4, z5, z6,z7, t, x, dd, m, g, flow_error; double noneu_mass_flow, phase_bias_unc,phase_prec_unc, this_density; int reset, freeze; /* calculate non-engineering units mass flow */ if (amp_sv1 < 1e−6) noneu_mass_flow =0.0; else noneu_mass_flow = tan(my_pi * p−>phase_diff/180); /* convertto engineering units */ Tz = p−>temperature_value − 20;p−>massflow_value = flow_factor * 16.0 * (FC1 * Tz + FC3 * Tz*Tz +FC2) * noneu_mass_flow /p−>v_freq; /* apply two-phase flow correction ifnecessary */ if (validating && do_two_phase_correction) { /* call neuralnet for calculation of mass flow correction */ t = VMV_temp_stats.mean;// mean VMV temperature x = RMV_dens_stats.mean; // mean RMV density dd= (TX_true_density − x) / TX_true_density * 100.0; m =RMV_mass_stats.mean; // mean RMV mass flow; g = gain_stats.mean; // meangain; nn_predict(t, dd, m, g, &flow_error); p−>massflow_value =100.0*m/(100.0 + flow_error); }S. Notice of Copyright

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by any one of the patentdocument or the patent disclosure, as it appears in the Patent andTrademark Office patent file or records, but otherwise reserves allcopyright rights whatsoever.

Other embodiments are within the scope of the following claims.

1. A flowmeter comprising: a vibratable conduit; a driver connected to the conduit for imparting a motion to the conduit; a sensor connected to the conduit for sensing conduit motion and generate a sensor signal based on the conduit motion; and a controller connected to the sensor to receive a sensor signal, the controller further comprising instructions to: generate a first density measurement from the sensor signal; compare a known density of a non-aerated fluid with the first density measurement; wherein in difference is a positive value, the mass flow error is increasing.
 2. The flowmeter of claim 1 wherein the controller provides a known, non-aerated density of the fluid flowing in the conduit.
 3. The flowmeter of claim 2 wherein the controller measures a second density measurement, and compares the second density measurement over the first density measurement, and computes an average density measurement when the difference is less than 0.01 units of density.
 4. The flowmeter of claim 3 wherein the controller updates the known non-aerated density of the fluid flowing in the conduit with the average density measurement. 